Title: Error when importing sql database to phpmyadmin
Last modified: August 19, 2016

---

# Error when importing sql database to phpmyadmin

 *  Resolved [ninja-master-jimmy-wong-fu](https://wordpress.org/support/users/ninja-master-jimmy-wong-fu/)
 * (@ninja-master-jimmy-wong-fu)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/)
 * Hi everyone.
 * I am attempting to transfer my live site to my localhost for testing and have
   taken the following steps:
 * 1) Uploaded the theme, plugins, and upload folders to my pc via Dreamweaver –
   maintaining the folder structure.
 * 2) I have exported the live .sql database and saved as a text file.
 * 3) I have changed the [http://www.mysite.co.uk](http://www.mysite.co.uk) occurrences
   with [http://localhost/mysite](http://localhost/mysite), so that hte paths to
   all documents are correct
 * However, when I go to import the sql file into phpmyadmin I get the following
   error:
 *     ```
       Error
   
       SQL query:
   
       -- phpMyAdmin SQL Dump
       -- version 2.8.2
       -- http://www.phpmyadmin.net
       --
       -- Host: localhost
       -- Generation Time: Nov 23, 2010 at 09:16 PM
       -- Server version: 4.1.20
       -- PHP Version: 5.2.8
       --
       -- Database: <code>oliverbee</code>
       --
       -- --------------------------------------------------------
       --
       -- Table structure for table <code>wp_commentmeta</code>
       --
       CREATE TABLE <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 = utf8 AUTO_INCREMENT =1;
   
       MySQL said: Documentation
       #1046 - No database selected
       ```
   
 * I believe I may have made a simple error somewhere.
 * Please let me know if you have encountered this or if you know of a solution 
   to this problem.
 * Thanks all
 * O

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [ninja-master-jimmy-wong-fu](https://wordpress.org/support/users/ninja-master-jimmy-wong-fu/)
 * (@ninja-master-jimmy-wong-fu)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1783598)
 * OK, I have taken the following steps:
 * 1) Created a blank database in phpmyadmin
 * 2) Imported my database
 * Everything seems fine but when I try to access wp-login.php I get an unstyled
   login screen that, when filled in, says object not found.
 * wp-install.php says the site has already been installed and that I need to clear
   old database tables first.
 * ??
 *  Thread Starter [ninja-master-jimmy-wong-fu](https://wordpress.org/support/users/ninja-master-jimmy-wong-fu/)
 * (@ninja-master-jimmy-wong-fu)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1783608)
 * Part 3:
 * 1) I have dropped the tables so I have a blank database
 * 2) I have installed wordpress and selected my theme
 * 3) I then try to import the backup database adn I get the following error
 *     ```
       Error
   
       SQL query:
   
       CREATE TABLE <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 = utf8 AUTO_INCREMENT =1;
   
       MySQL said: Documentation
       #1050 - Table 'wp_commentmeta' already exists
       ```
   
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1783609)
 * > I have installed wordpress
   >  […] Table ‘wp_commentmeta’ already exists
 * WP creates the tables during the install process. So you either need to import
   just the content for the various table. Or empty the database again, do not run
   the install process and import the entire sql dump into the database.
 * Have you reviewed [Moving_WordPress](http://codex.wordpress.org/Moving_WordPress)?
 *  Thread Starter [ninja-master-jimmy-wong-fu](https://wordpress.org/support/users/ninja-master-jimmy-wong-fu/)
 * (@ninja-master-jimmy-wong-fu)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1783899)
 * 1)exported database from live WordPress through built in feature in tools section
   
   2)performed a fresh install of WordPress on localhost 3)ftpd content essential
   files from live server: uploads, plugins and theme from live to localhost 4)activated
   localhost WordPress 5)imported database to localhost through phpmyadmin and assigned
   db name 6)set database details on wp-gonfig.php 7)logged in to localhost, set
   home page, adn checked for posts 8)search and replaced all themefiles so path
   names were correct 9)search and replace the database through phpmyadmin so path
   names are correct
 * VICTORY!
 *  [OSOsantoso](https://wordpress.org/support/users/ososantoso/)
 * (@ososantoso)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1784029)
 * i have the same problem. when I go to import the sql file into phpmyadmin I get
   the following error:
 * Error
    SQL query:
 * —
    — Database: `ososantoso` — — ——————————————————– — — Table structure for table`
   wp_commentmeta` — 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 DEFAULT CHARSET = utf8 AUTO_INCREMENT
   =1;
 * MySQL said:
 * #1046 – No database selected
 * help me please.. what should i do?
 *  [scavengerani](https://wordpress.org/support/users/scavengerani/)
 * (@scavengerani)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1784036)
 * in the “Format of imported file” uncheck “Do not use AUTO_INCREMENT for zero 
   values” Its work with me..

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Error when importing sql database to phpmyadmin’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 4 participants
 * Last reply from: [scavengerani](https://wordpress.org/support/users/scavengerani/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/error-when-importing-sql-database-to-phpmyadmin/#post-1784036)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
