When I run the following command from the open Windows command shell (Win7), it works fine and the backup is written to my file system. The MySQL database is located on a remote Linux server.
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump" -h *******.com -u ******* -p***** --databases ******* > "C:\******\_Database\backups\DB_%date:~0,3%.bak"
But when I put the same command in the batch file (whatever.bat) and run the bat file (with the pause command at the end), I get the error message "Got error: 1045: Access denied for user ' me ' @ 'c -24-2-64-138.hsd1.ut.comcast.net '(using password: YES) when trying to connect. "
Why does it work from an open command shell, but not when launched from a bat file? How can I do this job?
source
share