语法:load data infile “c:\xxx.csv” into table table_name;
1、ERROR 1290 The MySQL server is running with the --secure-file-priv option so it cannot execute this statement;
解决办法: show variables like '%secure%';
若 secure_file_priv 的值为NULL,修改MySQL安装路径下的my.ini,在末尾添加“secure-file-priv=路径名”这一行,重启mysql将要通过load data infile的文件放在上面所定义的路径下进行操作即可,或是“secure-file-priv= ”,这样就可以导入任意位置的文件,有时需要注意添加转义符“\”,路径为 “c:\\xxx.csv”
2,重启mysql时遇到 “net stop mysql”中的net不是内部命令, 这时需要将cmd 的安装路径放置在path环境变量中,可能是之前安装时误删了。