• 技术文章 >数据库 >MySQL

    mysql插入数据报错怎么办

    FXLFXL2020-09-03 09:11:56原创4590

    MySQL插入外部数据文件

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

    (推荐教程:mysql数据库学习教程

    报错!

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

    解决办法1:

    SET GLOBAL local_infile=1;

    解决办法2:

    退出,使用以下命令行重新登录

    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" ignore 1 lines;
    Query OK, 2998533 rows affected, 65535 warnings (36.36 sec)
    Records: 2998533  Deleted: 0  Skipped: 0  Warnings: 2998533
    专题推荐:mysql 数据
    上一篇:mysql如何查看所有表 下一篇:mysql怎么查找字段不为空的记录

    相关文章推荐

    • mysql怎么去掉换行符• mysql怎么显示所有视图• mysql创建用户和密码出现错误怎么办

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网