Mysql restore file.sql syntax error using command line

when i enter

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

      

still get this error "error 1064 <42000>:" you have an error in your Suntax SQL; check the manual corresponding to your version of MySql server for the correct syntax to use alongside it.

what is wrong with this statement?

+2


a source to share


3 answers


I resolved it using PowerShell:



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

+1


a source


This is due to a reserved word in MySQL, usually due to a version mismatch.



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

0


a source


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

my path is wrong. Shouldn't go into mysql and execute this statement

0


a source







All Articles