Title: Problems exporting importing SQL database&#8230;
Last modified: August 19, 2016

---

# Problems exporting importing SQL database…

 *  [moiremusic](https://wordpress.org/support/users/moiremusic/)
 * (@moiremusic)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/)
 * 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](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986921)
 * review this codex and see if it helps: [http://codex.wordpress.org/Restoring_Your_Database_From_Backup](http://codex.wordpress.org/Restoring_Your_Database_From_Backup)
 *  Thread Starter [moiremusic](https://wordpress.org/support/users/moiremusic/)
 * (@moiremusic)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986925)
 * And here are the default[ export](http://farm6.static.flickr.com/5052/5540829401_9abb2a8520_o.jpg)
   and [import](http://farm6.static.flickr.com/5017/5541411418_5da95676cd_o.jpg)
   settings:
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986929)
 * > #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](https://wordpress.org/support/users/moiremusic/)
 * (@moiremusic)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986936)
 * 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](https://wordpress.org/support/users/moiremusic/)
 * (@moiremusic)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986939)
 * > 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?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986941)
 * The easiest method would be to rename your old database to something like inspirot_wrdp1_old.
   Then try the import.
 *  Thread Starter [moiremusic](https://wordpress.org/support/users/moiremusic/)
 * (@moiremusic)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986952)
 * > 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.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 7 replies
 * 3 participants
 * Last reply from: [moiremusic](https://wordpress.org/support/users/moiremusic/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/problems-exporting-importing-sql-database/#post-1986952)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
