MySQL 1046 error while importing wordpress database

I am moving a locally developed Wordpress site to a client server, so I am trying to export a local database and import it to the server. I exported the .sql file according to the instructions here http://codex.wordpress.org/Backing_Up_Your_Database , but I keep getting this error when importing:

DROP TABLE IF EXISTS `wp_commentmeta` ;

MySQL said: Documentation
#1046 - No database selected 

Any help is greatly appreciated. Thank!

+5
source share
3 answers

As in the other two answers: I did not import the backup file into a specific database. I had to create a new database and upload a file to it, and it worked perfectly.

+4

:

USE MyWordpressDBName;
DROP TABLE IF EXISTS `wp_commentmeta` ;

MySql

+3

, . , , .

, ( , , , , , - ). :

http://codex.wordpress.org/Restoring_Your_Database_From_Backup

, :

mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql

.

+2

All Articles