WordPress.org

Forums

ID's not incrementing (4 posts)

  1. jasonrhouse
    Member
    Posted 9 years ago #

    Okay I followed all of the directions in moving your wordpress to a new server...but i am having a problem.
    I am downgrading from MySQL 4.1.18-standard to MySQL 4.0.25-standard.
    When I export my database I set the SQL export compatibility to MYSQL40 because I was getting a syntax error when trying to import.
    I can post or whatever the first time perfectly on my new server but then when I try to post I get the following error:

    WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type) VALUES ('1', '2006-05-01 21:14:44', '2006-05-02 03:14:44', 'okay this is a database test...it will work now since i prayed for it', '', 'Test Post', '', 'publish', 'open', 'open', '', 'test-post', '', '', '2006-05-01 21:14:44', '2006-05-02 03:14:44', '0', '0', '')

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3]
    SELECT category_id FROM wp_post2cat WHERE post_id =

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1)' at line 2]
    INSERT INTO wp_post2cat (post_id, category_id) VALUES (, 1)

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY category_id' at line 4]
    SELECT category_id FROM wp_post2cat WHERE post_id = ORDER BY category_id

    WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('','_pingme','1')

    WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('','_encloseme','1')

    Warning: Cannot modify header information - headers already sent by (output started at /home/jason/public_html/wp-includes/wp-db.php:102) in /home/jason/public_html/wp-admin/post.php on line 59

    I think my ID's are just not incrementing......but I have NO clue as to how to fix it.

    Thanks for any help!
    -Jason

  2. mjhammelgraphics-museorg
    Member
    Posted 9 years ago #

    I'm having a similar problem after upgrading from 1.2 to 2.0. All my old data is fine, but the first post I submitted went in as ID=0. The next post produced the following error message:

    WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('0','_encloseme','1')

    Warning: Cannot add header information - headers already sent by (output started at /home/httpd/home-muse/html/wp/wp-includes/wp-db.php:102) in /home/httpd/home-muse/html/wp/wp-admin/post.php on line 60

    Maybe I munged the database when I migrated? Is this the wp_postmeta table that's causing this? The id doesn't appear to be getting incremented and it also was not updated to match the current (or rather next) id, which should be 84 (there are 83 entries listed in the WP admin/manage/posts page).

  3. jasonrhouse
    Member
    Posted 9 years ago #

    could anybody help us please??????? mjhammelgraph, i used a temporary solution maybe permanent ;-) im not forsure....i got a free database from http://www.freesql.org and it is seeming to work pretty good

  4. mjhammelgraphics-museorg
    Member
    Posted 9 years ago #

    Hey Jason. This thread was going on in two places. But it looks like my problem was that I went from 1.2.1 directly to 2.0.2 and that broke the db. I reinstalled the original db at home, ran the 1.2.1 to 1.5 upgrade path (see http://codex.wordpress.org/Upgrade_1.2_to_1.5 which includes a link to the archives - http://static.wordpress.org/archive/ to get the 1.5 version). Then upgraded that to 2.0.2.

    Since I did this on my staging server, after I finished upgrading I had to dump the db and manually modify references to the staging server to point to the production server instead. There were only a few lines and a sed statement (on Linux) cleared that right up.

    I also have a newer MySQL server on the staging server than on the production server so I had to change all the lines that said

    ENGINE=MyISAM DEFAULT CHARSET=latin1

    to

    TYPE=MyISAM

    then I was able to load the upgraded db on the production server. It all seems to be working now. More tests coming, but at a minimum the posts are working again.

    Hope that helps Jason.

Topic Closed

This topic has been closed to new replies.

About this Topic