wangliang 1 жил өмнө
parent
commit
8d90944e97

+ 3 - 1
sop-business/src/main/java/com/qmth/sop/business/exec/MySQLExec.java

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