I tried to import a database and I received this error:

ERROR 1064 (42000): You have an error in your SQL syntax;

The command that I run is:

mysql -u [User Name] -p [database name] < /home/user/public_html/website.net/db.sql;

I don't see why it's giving me this error. Could it be a firewall issue?


This command should be run on shell (not on MySQL prompt) and without semicolon at the end. For example

$ mysql -uroot -p my_db < /home/user/public_html/website.net/db.sql

The error isn't in the command you're running, instead it is in the .sql file you're trying to import.

The firewall is unrelated, otherwise you'd see an error of the form "Unable to connect to mysql server".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.