开发者

Create database error MYSQL

I have the following error when trying to import .sql f开发者_JAVA百科ile into MYSQL from the command prompt.

C:\Program Files\MySQL\MySQL Workbench 5.2 CE\utilities>mysqldbimport --server=
root:password@localhost   <filepath>
# Source on localhost: ... connected.
# Importing definitions from <filepath>

ERROR: Invalid statement:
CREATE DATABASE `None`;

I have had a look at the command line parameters when using mysqldbimport.exe and found a skip command which gets past this error by adding --skip CREATE_DB, which imports however there is no data available as the process has been skipped.

How can I get around this error?


Can you manually create the database (either through console or other application), then skip the creation like you did there?

Edit;

Logging into MySQL console,

mysql> create database `testdb`;
Query OK, 1 row affected (0.05 sec)

mysql> use testdb;
Database changed
mysql>

You may have to edit the .sql file if possible, changing the Create database statement to "use testdb;", but it's hard to tell without knowing the full file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜