mysql导入文本步骤 1、修改mysql.ini ,增加配置
[mysqld] local_infile=ON [mysql] local_infile=ON
2、springboot mysql配置增加 allowLoadLocalInfile=true
url: jdbc:mysql://localhost:3306/flowable?allowLoadLocalInfile=true
3、执行SQL
/*controller*/ long start = System.currentTimeMillis(); String sql = "load data local infile 'd:/sys_product.txt' into table `sys_product` fields terminated by '\t'"; Map<String,String> map = new HashMap<>(); map.put("sql",sql); sysProductService.execute(map); long end = System.currentTimeMillis(); return "运行时间(毫秒): = " + (end - start); /*mapper*/ @Insert("${sql}") void execute(Map<String, String> map);
标签:map,mysql,导入,sql,文本,local,infile From: https://www.cnblogs.com/jssoft/p/17046891.html