Title: WordPress database error
Last modified: January 17, 2022

---

# WordPress database error

 *  Resolved [fanglinx](https://wordpress.org/support/users/fanglinx/)
 * (@fanglinx)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/)
 * Hi, I just migrated my test site to the live site a few days ago. When I activate
   the plugin, the database error message shows in my website error log. After that,
   I tried to send the test email and the email was successfully delivered. However,
   this error message keeps adding to my error log file every minute, which causes
   my error log file to keep growing.
 * BTW, I have already tried to repair the table but it did not work.
    Thanks a 
   lot!
 * `PHP message: WordPress database error Duplicate entry '0' for key 'PRIMARY' 
   for query INSERT INTO`wp_wpmailsmtp_tasks_meta`(`action`,`data`,`date`) VALUES('
   wp_mail_smtp_admin_notifications_update', 'W10=', '2022-01-17 09:25:45') made
   by require_once('wp-admin/admin-header.php'), do_action('in_admin_header'), WP_Hook-
   >do_action, WP_Hook->apply_filters, wp_admin_bar_render, do_action_ref_array('
   admin_bar_menu'), WP_Hook->do_action, WP_Hook->apply_filters, WPMailSMTP\Admin\
   AdminBarMenu->register, WPMailSMTP\Admin\AdminBarMenu->has_notifications, WPMailSMTP\
   Admin\Notifications->get_count, WPMailSMTP\Admin\Notifications->get, WPMailSMTP\
   Tasks\Task->register, WPMailSMTP\Tasks\Meta->add, WPMailSMTP\Tasks\Meta->add_to_dbPHP
   message: WordPress database error Duplicate entry '0' for key 'PRIMARY' for query
   INSERT INTO`wp_wpmailsmtp_tasks_meta`(`action`,`data`,`date`) VALUES ('wp_mail_smtp_admin_notifications_update','
   W10=', '2022-01-17 09:25:45') made by require_once('wp-admin/admin-header.php'),
   do_action('in_admin_header'), WP_Hook->do_action, WP_Hook->apply_filters, wp_admin_bar_render,
   do_action_ref_array('admin_bar_menu'), WP_Hook->do_action, WP_Hook->apply_filters,
   WPMailSMTP\Admin\AdminBarMenu->register, WPMailSMTP\Admin\AdminBarMenu->main_menu,
   WPMailSMTP\Admin\AdminBarMenu->has_notifications, WPMailSMTP\Admin\Notifications-
   >get_count, WPMailSMTP\Admin\Notifications->get, WPMailSMTP\Tasks\Task->register,
   WPMailSMTP\Tasks\Meta->add, WPMailSMTP\Tasks\Meta->add_to_dbPHP message: WordPress
   database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO`wp_wpmailsmtp_tasks_meta`(`
   action`,`data`,`date`) VALUES ('wp_mail_smtp_admin_notifications_update', 'W10
   =', '2022-01-17 09:25:45') made by require_once('wp-admin/admin-header.php'),
   do_action('in_admin_header'), WP_Hook->do_action, WP_Hook->apply_filters, wp_admin_bar_render,
   do_action_ref_array('admin_bar_menu'), WP_Hook->do_action, WP_Hook->apply_filters,
   WPMailSMTP\Admin\`
    -  This topic was modified 4 years, 4 months ago by [fanglinx](https://wordpress.org/support/users/fanglinx/).
    -  This topic was modified 4 years, 4 months ago by [fanglinx](https://wordpress.org/support/users/fanglinx/).
    -  This topic was modified 4 years, 4 months ago by [fanglinx](https://wordpress.org/support/users/fanglinx/).
    -  This topic was modified 4 years, 4 months ago by [fanglinx](https://wordpress.org/support/users/fanglinx/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Darshana](https://wordpress.org/support/users/darshanaw/)
 * (@darshanaw)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/#post-15269931)
 * Hi [@fanglinx](https://wordpress.org/support/users/fanglinx/),
 * Thanks for reaching out! It looks like you have experienced a database migration
   issue.
 * Could you please check the database structure of this table `wp_wpmailsmtp_tasks_meta`
   and make sure there’s a primary key & auto-increment set for the ID. In case 
   it helps, here’s [a screenshot](https://a.supportally.com/8xRSN8) for you to 
   follow.
 * I hope this helps. Thanks!
 *  Thread Starter [fanglinx](https://wordpress.org/support/users/fanglinx/)
 * (@fanglinx)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/#post-15271508)
 * Hi [@darshanaw](https://wordpress.org/support/users/darshanaw/),
 * Thanks for the response, I’ve tried this method but the database also showed 
   an error message:
 * #1062 – ALTER TABLE causes auto_increment resequencing, resulting in duplicate
   entry ‘1’ for key ‘PRIMARY
 * Can I clear the ‘wp_wpmailsmtp_tasks_meta’ table and try this method again? Or
   it may break the whole database if I do so?
 * Thanks!
 *  Plugin Support [Darshana](https://wordpress.org/support/users/darshanaw/)
 * (@darshanaw)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/#post-15274072)
 * Hi [@fanglinx](https://wordpress.org/support/users/fanglinx/),
 * As I have checked with our developers, you can clear the content of that table(
   don’t delete the database table) and then you also need to delete all the scheduled
   actions under the **WP Mail SMTP -> Tools -> Scheduled Actions** area.
 * Could you please give it a try and let us know how it goes.
 * Thanks!
 *  Thread Starter [fanglinx](https://wordpress.org/support/users/fanglinx/)
 * (@fanglinx)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/#post-15275666)
 * Hi, [@darshanaw](https://wordpress.org/support/users/darshanaw/)
 * Your advice perfectly solved the error.
    Thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WordPress database error’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

## Tags

 * [Duplicate Entry](https://wordpress.org/support/topic-tag/duplicate-entry/)

 * 4 replies
 * 2 participants
 * Last reply from: [fanglinx](https://wordpress.org/support/users/fanglinx/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-175/#post-15275666)
 * Status: resolved