错误:[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option
mysql>show variables like '%secure%';;
secure_file_prive=null -- 限制mysqld 不允许导入导出
secure_file_priv=/tmp/ -- 限制mysqld的导入导出只能发生在/tmp/目录下
secure_file_priv=' ' -- 不对mysqld 的导入 导出做限制
解决方法:
打开 my.ini 文件: 在文件中添加: secure-file-priv="D:/jb"
1. 将test.csv 文件导入mysql中
load data infile 'D:/jb/a.csv' -- CSV文件存放路径
into table test -- 要将数据导入的表名
fields terminated by ',' optionally enclosed by '"' escaped by '"' -- 字段之间以逗号分隔,字符串以半角双引号包围,字符串本身的双引号用两个双引号表示
lines terminated by '\r\n'; -- 数据行之间以\r\n分隔
执行成功效果如下: