|
@@ -105,9 +105,11 @@ public class MySQLExec {
|
|
|
string = string.replaceAll("\\#\\{dynamicFields\\}", stringJoiner.toString());
|
|
|
IOUtils.write(string.getBytes(StandardCharsets.UTF_8), new FileOutputStream(file));
|
|
|
|
|
|
- String cmdarray[] = {"mysql -h" + this.host + " -P" + this.port + " -u" + this.username + " -p" + this.password + " " + this.databaseName, "source " + file.getAbsolutePath()};
|
|
|
+ String cmdarray[] = {"mysql -h" + this.host + " -P" + this.port + " -u" + this.username + " -p" + this.password + " " + this.databaseName + "source " + file.getAbsolutePath()};
|
|
|
Runtime runtime = Runtime.getRuntime();
|
|
|
Process process = null;
|
|
|
+ log.info("cmdarray[0]:{}", cmdarray[0]);
|
|
|
+ log.info("cmdarray[1]:{}", cmdarray[1]);
|
|
|
try {
|
|
|
process = runtime.exec(cmdarray[0]);//cmd之后执行数组的第一个条件进入数据库
|
|
|
//执行了第一条命令以后已经登录到mysql了
|