ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/tmp/ck.txt into table test1' at line 1

使用load命令导入数据时报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/tmp/ck.txt into table test1' at line 1

查看 secure_file_priv 对应的值:

  • secure_file_priv 为 NULL 时,表示限制mysqld不允许导入或导出
  • secure_file_priv 为 /tmp 时,表示限制mysqld只能在/tmp目录中执行导入导出,其他目录不能执行
  • secure_file_priv 没有值时,表示不限制mysqld在任意目录的导入导出

 

 

修改 secure_file_priv 值:

在 /etc/my.cnf 里加入一行代码: secure_file_priv='' 

重启数据库,再导入数据。

 

posted @ 2022-06-09 16:54  心恩惠动  阅读(870)  评论(0)    收藏  举报