Mysql8.0导入数据时出错

  在Windows操作系统下,使用命令行将已经创建好的txt文件导入到mysql的pet表中。

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

  输入命令:show variables like 'local_infile'; 

  显示 local_infile是关闭的,输入语句:set global local_infile=ON; 将local_infile打开。(如果报错,无法修改,则需登陆root用户进行修改)

  然后退出当前用户,用以下语句登陆:mysql --local-infile -u username -p,再输入导入数据的语句则可以成功导入。

原文地址:https://www.cnblogs.com/ydc198/p/10648785.html