error 1064(42000) while trying to execute mysqldump command [duplicate]

你说的曾经没有我的故事 提交于 2019-12-05 09:14:49

问题


im trying to run the following command: mysql> mysqldump --all-databases > dump.sql; on my local(On my pc) Mysql 5.5 server but I keep getting this error:

mysql> mysqldump --all-databases > dump.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
dump --all-databases > dump.sql' at line 1.

回答1:


mysqldump is a command you invoke at the shell prompt, not within the mysql client environment.

mysql> exit
$ mysqldump --all-databases > dump.sql



回答2:


You must execute that command from the system shell, don't forget to use username and password to access all databases, example:

mysqldump -u root -p --all-databases > dump.sql


来源:https://stackoverflow.com/questions/19281026/error-106442000-while-trying-to-execute-mysqldump-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!