WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] New Records Get ID = 0 After MySQL InnoDB Restore (6 posts)

  1. joeloew
    Member
    Posted 8 years ago #

    Stack: WP v2.0.3/IIS6/MySQL 5.0/PHP5
    DB type is InnoDB.

    I recently restored a mysql backup from one machine to another via sql script.

    There were no restore errors, but new Users, Pages and Posts do not complete correctly. There are no errors when creating items via dashboard.

    Using wp-register.php says: "ERROR: Couldn’t register you... please contact the webmaster !"

    Pages and Posts just dissappear; the new user has only the wp_user data (no meta).

    Upon closer inspection, I see that the new record has an ID of 0 and child updates are missing (which explains why the meta lookups fail).

    I can manually change the ID and create the meta, but the next attempt still tries a record with ID 0.

    If I leave the 0 record, subsequent records still do not go to the correct next ID.

    I assume this is a db setup problem, but not sure how to fix it.

    Help!!!

    -joe

  2. silpstream
    Member
    Posted 8 years ago #

    Did you check to see that 'auto-increment' was setup properly for all the id fields?

  3. joeloew
    Member
    Posted 8 years ago #

    Yes, that did occur to me, but it seems this is only an option for MyISAM, not InnoDB. Did I miss something?

    [thanks, silpstream for finding my post! :-)]

  4. silpstream
    Member
    Posted 8 years ago #

    I'm not sure because I don't use this, but a quick check shows that it is available. Check here: http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-column.html

  5. joeloew
    Member
    Posted 8 years ago #

    Thanks! I'll investigate later tonight and update the post as resolved if so...

  6. joeloew
    Member
    Posted 8 years ago #

    Seems to have worked!

    I also changed tables to MyISAM, but this should work for either.

    My data was a little munged, so be sure to remove partial transactions (fat lot of good the InnoDB transaction rollback did :-)).

    Thanks, silpstream.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags