Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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
share|improve this answer

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".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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