MySQL插入数据报错解决

MySQL插入外部数据文件

load data local infile "path/myfile.csv" into table table_name fields terminated by "," lines terminated by  "\r\n";

报错!

ERROR 1148 (42000): The used command is not allowed with this MySQL version

解决办法: 退出,使用以下命令行重新登录

mysql --local-infile=1 -u root -p

再次插入,成功!!!

load data local infile "path/myfile.csv" into table table_name fields terminated by "," lines terminated by  "\r\n";
Query OK, 3000001 rows affected (29.51 sec)
Records: 3000001  Deleted: 0  Skipped: 0  Warnings: 0

猜你喜欢

转载自www.cnblogs.com/ohou/p/12034254.html