• I need help restoring my wordpress database using Myphp.
    My host reinstalled wordrpress 3.2.1, but I think that my blog which I am trying to restore was probably using an older version. I mention it incase it’s important.

    When I go to Myphp and import my backup, I receive this error:

    Error
    SQL query:

    CREATE TABLE wp_commentmeta (

    meta_id BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    comment_id BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‘0’,
    meta_key VARCHAR( 255 ) DEFAULT NULL ,
    meta_value LONGTEXT,
    PRIMARY KEY ( meta_id ) ,
    KEY comment_id ( comment_id ) ,
    KEY meta_key ( meta_key )
    ) ENGINE = MYISAM AUTO_INCREMENT =50960 DEFAULT CHARSET = utf8;

    MySQL said:

    #1046 – No database selected

    What am I doing wrong or what do I need to do differently?

    Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    #1046 – No database selected

    See http://codex.wordpress.org/Restoring_Your_Database_From_Backup

    It sounds like you are leaving out the step of

    2. Click databases, and select the database that you will be importing your data into.

    Thread Starter msawesome

    (@msawesome)

    Hi Jan!

    Thanks so much for your reply. I went ahead and double checked that I had selected a database and then got this error message:

    SQL query:

    CREATE TABLE wp_commentmeta (

    meta_id BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    comment_id BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‘0’,
    meta_key VARCHAR( 255 ) DEFAULT NULL ,
    meta_value LONGTEXT,
    PRIMARY KEY ( meta_id ) ,
    KEY comment_id ( comment_id ) ,
    KEY meta_key ( meta_key )
    ) ENGINE = MYISAM AUTO_INCREMENT =50960 DEFAULT CHARSET = utf8;

    MySQL said:

    #1050 – Table ‘wp_commentmeta’ already exists

    Is this because my host did a fresh install of wordpress? Should I delete that so my database is empty and then restore using my backup?

    Thanks!

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    If the database is new, and you are confident in your .SQL backup file, and haven’t put in anything new THEN you can drop the existing tables and re-import that file.

    On my MySQL dumps (I use the command line) the backup contains these lines for each table:

    DROP TABLE IF EXISTS "wp_commentmeta";

    So when I restore the file I don’t get the error you are getting. If you drop your tables first then you should be fine.

    Edit: Esmi? How do you get the backtick inside the code section to work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I need help restoring my wordpress database.’ is closed to new replies.