Title: database error Duplicate entry
Last modified: June 24, 2018

---

# database error Duplicate entry

 *  [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/database-error-duplicate-entry-2/)
 * As of yesterday, a large number of error messages appear in my web server error
   log, similar to the following:`
    PHP message: WordPress database error Duplicate
   entry ‘2018-06-23-#hash#3030242a21c266cad1b7f3bb8783ca34c6956873-Unknow’ for 
   key ‘date_ip_agent’ for query UPDATE `wp_statistics_visitor` SET `ip` = ‘#hash#
   3030242a21c266cad1b7f3bb8783ca34c6956873’ WHERE `ip` = ‘<some address>’ AND `
   last_counter` = ‘2018-06-23’ made by require(‘wp-blog-header.php’), require_once(‘
   wp-load.php’), require_once(‘/wordpress/wp-config.php’), require_once(‘wp-settings.
   php’), include_once(‘/plugins/wp-statistics/wp-statistics.php’), WP_Statistics-
   >run, WP_Statistics->check_opt_out`
 * I note that this may be associated with the following anomalous behavior:
    – 
   the privacy opt out message appeared spontaneously (not 1 year after having agreed
   to the conditions!) – clicking on either of the two options had no effect; the
   message remained on screen – it seems that purging the local browser cache may
   allow the message to stop being displayed – the same error message occurs multiple
   times for a given IP address
 * Plugin version: 12.3.6.2
 * Privacy Settings:
    opt out: enabled Hash IP Addresses: NOT enabled Store entire
   user agent string: NOT enabled

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

 *  [johanna2patricia](https://wordpress.org/support/users/johanna2patricia/)
 * (@johanna2patricia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/database-error-duplicate-entry-2/#post-10440119)
 * I have exactly the same. Massive error messages about a duplicate key as mentioned
   above.
    So many, that my site went down several times for using too much resources.
 * Backend log: WordPress database error Duplicate entry ‘2015-03-14’ for key ‘unique_date’
   for query ALTER TABLE wp_statistics_visit ADD UNIQUE KEY `unique_date` (`last_counter`)
   made by require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘
   wp-settings.php’), include_once(‘/plugins/wp-statistics/wp-statistics.php’), 
   WP_Statistics->run, WP_Statistics_Admin->__construct, WP_Statistics_Install->
   __construct, dbDelta\n,
 * What is the matter? And can somebody help us please?
 * Johanna
 *  [alphageekuk](https://wordpress.org/support/users/alphageekuk/)
 * (@alphageekuk)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/database-error-duplicate-entry-2/#post-10497833)
 * I’m getting a similar error logged too –
 * WordPress database error Duplicate entry ‘2018-07-16-/piano-teacher-blog/’ for
   key ‘date_2’ for query INSERT INTO `wp_statistics_pages` (`uri`, `date`, `count`,`
   id`) VALUES (‘/piano-teacher-blog/’, ‘2018-07-16’, 1, ‘1944’) made by require(‘
   wp-blog-header.php’), wp, WP->main, do_action_ref_array, WP_Hook->do_action, 
   WP_Hook->apply_filters, WP_Statistics_Frontend::init, WP_Statistics_Hits->Pages
 * Version 12.3.6.3

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

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

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

## Tags

 * [error messages](https://wordpress.org/support/topic-tag/error-messages/)

 * 2 replies
 * 3 participants
 * Last reply from: [alphageekuk](https://wordpress.org/support/users/alphageekuk/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/database-error-duplicate-entry-2/#post-10497833)
 * Status: not resolved