Quantcast
Channel: Topic Tag: database | WordPress.org
Viewing all articles
Browse latest Browse all 11075

bdemont on "New posts defaulting to '0' primary key"

$
0
0

Hello,

I have a huge problem in my wordpress database after reinstall a dump file on the same host :

Every new things are set on 0 primary key, so it doesn't work :
This is my php log :

WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO <code>wp_posts</code> (<code>post_author</code>,<code>post_date</code>,<code>post_date_gmt</code>,
<code>post_content</code>,<code>post_content_filtered</code>,<code>post_title</code>,<code>post_excerpt</code>,<code>post_status</code>,<code>post_type</code>,
<code>comment_status</code>,<code>ping_status</code>,<code>post_password</code>,<code>post_name</code>,<code>to_ping</code>,<code>pinged</code>,<code>post_modified</code>,
<code>post_modified_gmt</code>,<code>post_parent</code>,<code>menu_order</code>,<code>post_mime_type</code>,<code>guid</code>) VALUES (5,'2014-10-13 11:19:21','0000-00-00 00:00:00','','','Auto Draft','','auto-draft','post','open','open','','','','','2014-10-13 11:19:21','0000-00-00 00:00:00',0,0,'','') made by get_default_post_to_edit, wp_insert_post PHP Warning: Creating default object from empty value in ##\wp-admin\includes\post.php on line 567

And i have this problem for every things: medias, shortcode, all new added things.

I read about that : http://wordpress.stackexchange.com/questions/165277/new-posts-defaulting-to-0-primary-key

Can i do that on all tables in my database ?
ALTER TABLE wp_posts AUTO_INCREMENT = 1001;

Or have you another solution ?

I read a similar issue : http://gielberkers.com/fix-duplicate-entry-1-key-primary-data-migration-magento/ with only this sql code : SET sql_mode='NO_AUTO_VALUE_ON_ZERO';

I'm on a production server so i wanted to have your opinion about that before testing.

Thank you,
Ben


Viewing all articles
Browse latest Browse all 11075

Trending Articles