mysql dump issue

◇◆丶佛笑我妖孽 提交于 2019-12-12 06:59:55

问题


mysql gives me the syntax error with the following line... i dont know what is wrong with this...

mysqldump -u root -p root mydatabase > dumpfile.sql

i am using windows vista...

plz help here.. thnx..


回答1:


Make sure that you are running this from the normal command line and not within the mysql command line. So like this:

C:\[path to mysqldump app] > mysqldump -u root -p root mydatabase > dumpfile.sql

not

mysql > mysqldump -u root -p root mydatabase > dumpfile.sql



回答2:


The -p part is the problem. From the manual:

The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.

Try

mysqldump -u root -proot mydatabase > dumpfile.sql

But in the future, please ask a proper question including any error messages you get (you certainly got one in this case) so people don't have to guess.



来源:https://stackoverflow.com/questions/3400390/mysql-dump-issue

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