• I’m attempting to export the database for my site, with the intention of editing and re-importing it. As a simple test, I exported the database (called “inspirot_wrdp1”) from the phpMyAdmin section of Cpanel, and tried to re-import the unmodified file the same way. But when I do, I get the following error:

    SQL query:
    
    --
    -- Database: <code>inspirot_wrdp1</code>
    --
    CREATE DATABASE <code>inspirot_wrdp1</code> DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    
    MySQL said: Documentation
    #1007 - Can't create database 'inspirot_wrdp1'; database exists

    Seems like it would be a simple export/import. What am I missing here?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    Thread Starter moiremusic

    (@moiremusic)

    And here are the default export and import settings:

    #1007 – Can’t create database ‘inspirot_wrdp1’; database exists

    You can’t create a new database with the same name as the old one.

    Thread Starter moiremusic

    (@moiremusic)

    Thank t-p. The link you sent makes perfect sense until the last step (“2. Put the backed-up SQL back into MySQL:”).

    I was trying to use the Import tab. Is this wrong? I’m not really sure how to use the commands listed on that link:

    user@linux:~/files/blog> mysql -h mysqlhostserver -u mysqlusername
     -p databasename < blog.bak.sql
    
    Enter password: (enter your mysql password)
    user@linux~/files/blog:>
    Thread Starter moiremusic

    (@moiremusic)

    You can’t create a new database with the same name as the old one.

    Thanks, esmi. Then how do I alter the database manually and replace the old one?

    The easiest method would be to rename your old database to something like inspirot_wrdp1_old. Then try the import.

    Thread Starter moiremusic

    (@moiremusic)

    The easiest method would be to rename your old database to something like inspirot_wrdp1_old. Then try the import.

    Good idea. But I tried this, and still get an error:

    Error
    
    SQL query:
    
    --
    -- Database: <code>inspirot_wrdp1</code>
    --
    -- --------------------------------------------------------
    --
    -- Table structure for table <code>wp_commentmeta</code>
    --
    CREATE TABLE IF NOT EXISTS <code>wp_commentmeta</code> (
    <code>meta_id</code> bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT ,
    <code>comment_id</code> bigint( 20 ) unsigned NOT NULL default '0',
    <code>meta_key</code> varchar( 255 ) default NULL ,
    <code>meta_value</code> longtext,
    PRIMARY KEY ( <code>meta_id</code> ) ,
    KEY <code>comment_id</code> ( <code>comment_id</code> ) ,
    KEY <code>meta_key</code> ( <code>meta_key</code> )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;
    
    MySQL said: Documentation
    #1046 - No database selected
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems exporting importing SQL database…’ is closed to new replies.