sql 批量插入慢解决办法
之前的数据库连接 批量新增2000条数据需要30s左右
jdbc:mysql://192.168.50.226:3306/parkdb?characterEncoding=UTF-8&useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai
修改后的连接,添加 rewriteBatchedStatements=true 即可 2000条大概0.5s
jdbc:mysql://192.168.50.226:3306/parkdb?characterEncoding=UTF-8&useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true