Title: Database Error when importing WordPress site
Last modified: August 30, 2016

---

# Database Error when importing WordPress site

 *  [MsTyger](https://wordpress.org/support/users/mstyger/)
 * (@mstyger)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/database-error-when-importing-wordpress-site/)
 * I have been trying to move a wordpress site to a new host (the old host is now
   gone) I downloaded all of the files, and a backup of the database and I have 
   followed these steps.. [http://www.wpexplorer.com/migrating-wordpress-website/](http://www.wpexplorer.com/migrating-wordpress-website/)
 * However, when I try to import the database to the new host I just get an error
   message as follows :
 * Error
    SQL query:
 * —
    — Table structure for table `wp_commentmeta` — DROP TABLE IF EXISTS `wp_commentmeta`;
 * MySQL said: Documentation
 * #1046 – No database selected
 * Is
 * I am not expereinced with databases so I need very basic advice

Viewing 1 replies (of 1 total)

 *  [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/database-error-when-importing-wordpress-site/#post-6463978)
 * Did you first go to cPanel > MySQL and make a database, SQL user and password(
   ultimately matched in wp-config.php)? A set of tables is often called a “database”,
   but a set of tables first needs an actual database (shell or container or whatever
   you might call that) at the server before phpMyAdmin can be used to import tables.
   Or…
 * If you already have a database at the server and it already contains tables with
   the same table_prefix you are trying to import, you will first have to drop its
   current tables so you can then import your replacement.
 * note: Always, always make a full export backup of tables before changing anything
   in a database.

Viewing 1 replies (of 1 total)

The topic ‘Database Error when importing WordPress site’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/database-error-when-importing-wordpress-site/#post-6463978)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
