MYSQL导入数据出现ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

MYSQL导入数据出现The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

方法一:

这个原因其实很简单,是因为在安装MySQL的时候限制了导入与导出的目录权限

只能在规定的目录下才能导入

我们需要通过下面命令查看 secure-file-priv 当前的值是什么

show variables like '%secure%';

 

我们可以看到value的值为/var/lib/mysql-files/

那么我们把导入的路径改为上面的值就可以了

方法二:

  如果觉得这样太麻烦,那么我们就需要改配置文件,

可以参考:http://blog.csdn.net/lyhvoyage/article/details/50521440

我改完之后觉得,原来的位置挺好,以后可能有需要再弄吧。

---恢复内容结束---

原文地址:https://www.cnblogs.com/enjong/p/8538724.html