4

But why? I've imported it in OS X and on another Linux machine, this one however plain refuses..

Where am I going wrong?

Output:

mysql> mysql -u root -p explore < /tmp/explore.sql;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u root -p explore < /tmp/explore.sql' at line 1

2 Answers 2

5

You are trying to run a shell command from the MySQL command line interpreter. You need to run that from BASH (or any other shell), no the MYSQL command prompt.

Like this in Linux:

$ mysql -u root -p explore < /tmp/explore.sql;

Like this in Windows:

C:\> mysql -u root -p explore < c:\tmp\explore.sql;
Sign up to request clarification or add additional context in comments.

1 Comment

That... Didn't make sense to me. It was, however, as simple as that. Thanks. :)
1

try to execute this

source /tmp/explore.sql;

after logging in mysql prompt

or

get out from the mysql prompt you are already there and run the command you are trying. Thanks

Comments

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.