I would like execute the following command with Java:
"C:\Program Files\MySQL\MySQL Server 5.5\bin\"mysqldump -u root --password=xxxx --routines database > C:\Users\john\Desktop\backup.sql
The command works perfectly when I use the Windows cmd.exe but not with my Java application.
cmd = "\"C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin\\\"mysqldump
-u root --password=xxxx --routines database > C:\\Users\\john\\Desktop\\backup.sql
Runtime runtime = Runtime.getRuntime();
process = runtime.exec(cmd);
I got the following error:
"C:\Program Files\MySQL\MySQL Server 5.5\bin\"mysqldump -u root --password=xxxx --routines database > C:\Users\john\Desktop\backup.sql java.io.IOException: Cannot run program ""C:\Program": CreateProcess error=5, Access is denied
Do you have any idea?
Thank you.