我在java中尝试这个命令
executeCmd = DBConfig.dbLocation + "\\mysqldump -u " + mysqlUser +
" -p"+DBConfig.dbPass + " " + DBConfig.dbName +
" -r -opt>supervisorDbBkup.sql";
它给了我代码 1 而不是 0
String executeCmd = "";
executeCmd = DBConfig.dbLocation+"\\mysqldump -u"+mysqlUser+
" -p"+DBConfig.dbPass+" "+DBConfig.dbName+" -r -opt>supervisorDbBkup.sql";
Process runtimeProcess =Runtime.getRuntime().exec(executeCmd);
int processComplete = runtimeProcess.waitFor();
if(processComplete == 0){
return "Backup taken successfully";
} else {
return "Could not take mysql backup";
}
这是我正在运行的命令:
E:\program file\MySQL\MySQL Server 5.5\bin\mysqldump -uroot -p0502 dashboardsupervisor -r -opt>supervisorDbBkup.sql
任何的想法