开发者

Create database error MYSQL

开发者 https://www.devze.com 2023-04-07 15:21 出处:网络
I have the following error when trying to import .sql f开发者_JAVA百科ile into MYSQL from the command prompt.

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

精彩评论

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

关注公众号