WordPress.org

Support

Support » How-To and Troubleshooting » Duplicate entry ‘4’ for key 1 (database corruption(?))

Duplicate entry ‘4’ for key 1 (database corruption(?))

  • ‘lo

    one of my users is getting this error with WordPress 1.5.2 – PHP 4.4.1 and mySQL 4.1.15 on FreeBSD/Apache 1.3.34

    WordPress database error: [Duplicate entry ‘4’ for key 1]
    INSERT INTO wp_posts (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent, menu_order) VALUES (‘4’, ‘1’, ‘2005-11-07 08:30:19’, ‘2005-11-07 12:30:19’, ‘ddwdwdwdw’, ‘wdw’, ”, ‘publish’, ‘open’, ‘open’, ”, ‘wdw’, ”, ‘2005-11-07 08:30:19’, ‘2005-11-07 12:30:19’, ‘0’, ‘0’)

    Warning: Cannot modify header information – headers already sent by (output started at /path/to/wp-includes/wp-db.php:98) in /path/to/wp-admin/post.php on line 170

    —-
    i’ve never encountered this issue before, even after installing/upgrading 100’s of WordPress installations. for some reason, new posts/pages are being assigned an ID “4” – using phpMyAdmin, i tried renaming the existing post with the ID “4” to “45”. when i tried posting a new entry/page, it worked but then an entry made after that renders the same error. tried changing themes, disabled plugins, it’s a no go. selecting the “Advance Editing” button also renders the same error.

    the blog was originally WordPress version 1.2.x upgraded to 1.5 then 1.5.2 – not quite sure if that helps or is this simply nothing more than database corruption? please advise, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • it looks like if 2 or more WordPress sites are using the same database, the error occurs when the table prefix for each site doesn’t have an underscore.

    WordPress 1 – wp_ prefix
    WordPress 2 – wp2 prefix (doesn’t work)

    WordPress 1 – wp_ prefix
    WordPress 2 – wp2_ prefix (this one works.)

    I am having a similar problem:

    WordPress database error: [Duplicate entry ‘0’ for key 1]
    INSERT INTO wp_posts (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent, menu_order) VALUES (”, ‘1’, ‘2006-01-03 10:18:19’, ‘2006-01-03 08:18:19’, ‘testing again’, ‘test’, ”, ‘publish’, ‘open’, ‘open’, ”, ‘test’, ”, ‘2006-01-03 10:18:19’, ‘2006-01-03 08:18:19’, ‘0’, ‘0’)

    Warning: Cannot modify header information – headers already sent by (output started at /home/loginname/public_html/ibis/wp-includes/wp-db.php:98) in /home/loginname/public_html/ibis/wp-admin/post.php on line 170

    The above solution doesn’t help- Can anyone help me?

    I got the exact same error as Ibis13 on my wordpress today, can’t add new posts, new pages etc…

    Anybody?

    Thx!

    Changing the prefix on the database solved my problems. Thx!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Duplicate entry ‘4’ for key 1 (database corruption(?))’ is closed to new replies.