|
@@ -8,6 +8,7 @@ import com.zkqy.web.controller.tool.TestController;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -40,7 +41,8 @@ public class ExportController {
|
|
|
private DownloadController downloadController;
|
|
|
|
|
|
// 执行当前环境下的mysql
|
|
|
- private static final String MYSQLDUMP_PATH = "/usr/local/mysql/bin/mysqldump";
|
|
|
+ @Value("${projectDownloadZip.mysql}")
|
|
|
+ private String MYSQLDUMP_PATH;
|
|
|
|
|
|
// sql 生成路径
|
|
|
private static final String SQL_OUTPUT_PATH = "sql";
|
|
@@ -115,6 +117,8 @@ public class ExportController {
|
|
|
|
|
|
private List<String> buildMysqldumpCommand(String databaseName, DataSource dataSource) {
|
|
|
// 使用 Arrays.asList 创建不可变 List
|
|
|
+ // windwos: mysqldump --column-statistics=0
|
|
|
+ // Linux: 需要指明mysql脚本地址-》/usr/local/mysql/bin/mysqldump
|
|
|
return new ArrayList<>(Arrays.asList(
|
|
|
MYSQLDUMP_PATH,
|
|
|
"-h", dataSource.getDatabaseIp(),
|