我无法使用以下代码生成备份:
public boolean backupDB(String dbName, String dbUserName, String dbPassword, String path) {
String[] executeCmd = new String[] {
"C:\\xampp\\mysql\\bin\\mysqldump.exe ",
"-u",
dbUserName,
"-p",
dbPassword,
"--add-drop-database",
"-B",
dbName,
"-r",
path
};
final ProcessBuilder pb = new ProcessBuilder(Arrays.asList(executeCmd));
final Process p;
try {
p = pb.start();
int processComplete = p.waitFor();
我的主要班级:
boolean backupDB = backup.backupDB("bd_relatorios", "root", "", "C:\\Users\\Gabriel\\Documents\\Nova pasta");
我的转储出现权限错误。