|
@ -23,7 +23,7 @@ public class DcMYSQLUtil { |
|
|
cmd = "cmd /c mysqldump --single-transaction " + " -h" + host + " -P" + port + " -u" + userName + " -p" + password + " --databases --skip-extended-insert " + dbName + " > " + file.getPath(); |
|
|
cmd = "cmd /c mysqldump --single-transaction " + " -h" + host + " -P" + port + " -u" + userName + " -p" + password + " --databases --skip-extended-insert " + dbName + " > " + file.getPath(); |
|
|
} else { |
|
|
} else { |
|
|
// Linux 需要加上 /usr/local/mysql/bin/
|
|
|
// Linux 需要加上 /usr/local/mysql/bin/
|
|
|
cmd = "/usr/local/mysql/bin/mysqldump --single-transaction " + " -h" + host + " -P" + port + " -u" + userName + " -p'" + password + "' --databases --skip-extended-insert " + dbName + " > " + file.getPath(); |
|
|
cmd = "bash -c /usr/local/mysql/bin/mysqldump --single-transaction " + " -h" + host + " -P" + port + " -u" + userName + " -p'" + password + "' --databases --skip-extended-insert " + dbName + " > " + file.getPath(); |
|
|
} |
|
|
} |
|
|
System.out.printf("cmd命令为:%s%n", cmd); |
|
|
System.out.printf("cmd命令为:%s%n", cmd); |
|
|
try { |
|
|
try { |
|
|