Skip to content

Instantly share code, notes, and snippets.

@zh4n7wm
Last active December 11, 2019 03:38
Show Gist options
  • Select an option

  • Save zh4n7wm/c6faa44a7c41fece742bf5bd4b7f45e4 to your computer and use it in GitHub Desktop.

Select an option

Save zh4n7wm/c6faa44a7c41fece742bf5bd4b7f45e4 to your computer and use it in GitHub Desktop.
[MySQL] load data local infile

错误信息

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

解决

修改 MySQL 配置文件

my.cnf 中的 [client][mysqld] 中增加 loose-local-infile=1

重启 MySQL 后查看该值

SHOW VARIABLES LIKE 'local_infile';

修改线上系统

SET GLOBAL local_infile = true;

命令中增加 --local-infile 参数

mysql -u myuser -p --local-infile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment