运行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