浏览代码

db_log修改

wangliang 1 年之前
父节点
当前提交
8d90944e97
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      sop-business/src/main/java/com/qmth/sop/business/exec/MySQLExec.java

+ 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());
                 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了