1

I have the following error when trying to import .sql file 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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

that had sprung to mind, however I was not entirely sure how to do this, could you advise?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.