问题
I am using mysqldump to take backup of my database, but the command is not working..
the command i am using is mysqldump -u root dbname> 'c:\backupdatafolder\backup.sql'
i am running this command in MySQL cli but not running,..is there any thing wrong in the command?
回答1:
You are supposed to run that on the command line of your operating system not on the MySQL CLI.
cd
to the bin folder of MySQL first, something like C:\mysql\bin
or wherever your MySQL is installed on
回答2:
If the mysqldump can not be identified by your CMD prompt (I believe you are using Windows), then you first have to go to the bin folder where this command can be found. In my case, the path is "C:\wamp\bin\mysql\mysql5.5.24\bin", it would be more or less the same path for you. After that open your CMD prompt and go to this path by command "cd C:\wamp\bin\mysql\mysql5.5.24\bin". Now you should run your mysqldump command for taking the backup as you have been trying. Hope this helps!
来源:https://stackoverflow.com/questions/2979464/mysqldump-command-not-working