热线电话:13121318867

登录
2021-01-23 阅读量: 515
Mysql数据导入导出时提示secure-file-priv option问题的解决方案报错1290

Mysql数据库进行数据从文件导入或者导出到文件时,提示 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement ,原因及解决方案如下:

一些版本的Mysql对此做了限制,默认不允许,可以进入到Mysql后台通过如下指令查看

mysql -u root -p # 输入密码或者直接mysql进入

mysql> show variables like 'secure_file_priv';

有三种情况

<1> 如果value值为null,则表示禁止

<2> value值为文件目录,则表示只允许从该目录下文件导入或者导出到该目录(子目录不允许)

<3> value值为空,则表示不限制存放目录

可以通过修改mysql的配置文件,查找 my.cnf文件,查看其是否有

secure_file_priv=

这一行内容,如果没有,则手动添加,注意=号一定要有

secure_file_priv= # 表示不限制目录

修改完配置文件后,重启mysql服务生效。

70.5882
0
关注作者
收藏
评论(0)

发表评论

暂无数据