2

when I input

mysql -u root -p XXXX dbname < c:/filename.sql

alway get this error "error 1064 <42000>:" you have an error in your SQL suntax; check the manual that corresponds to your MySql server version for the right syntax to use near .....

what is wrong with this statement?

2
  • there's nothing wrong with the statement, its the filename.sql, most probably something to do with your query check out the error Commented Apr 26, 2010 at 10:06
  • when i put mysqldump -u username -ppassword database_name > dump.sql; I get same error 1064 <42000>:... Commented Apr 26, 2010 at 11:08

3 Answers 3

1

I resolved it using PowerShell:

Get-Content "c:/filename.sql" | .\mysql.exe -uroot -pXXXX dbname

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

Comments

0

It is due to a reserved word in MySQL, typically because of a version mismatch.

http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

Comments

0

right one is C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u root -p mysql>backup_database.sql Enter password: ********

my path not right. Should not log into mysql and then execute that statement

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.