MySQL中LOAD DATA INFILE出现The used command is not allowed with this MySQL version问题

原文链接: http://www.cnblogs.com/chhhh/p/10640644.html

运行Load data local infile命令时:

mysql> LOAD DATA LOCAL INFILE '/path/pet.txt INTO TABLE tablename;
出现:

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

解决:

输入:show global variables like 'local_infile';

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile | OFF |
+---------------+-------+

然后:mysql> set global local_infile = 'ON';

登录时:mysql --local-infile=1 -u root -p

转载于:https://www.cnblogs.com/chhhh/p/10640644.html

猜你喜欢

转载自blog.csdn.net/weixin_30783629/article/details/94878152