Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
我在把csv中的data导入一个·table时候出现的
The MySQL server is running with the --secure-file-priv option
ERROR 1290 (HY000) at line 1: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
查看一下secure_file_priv的数值
show variables LIKE '%secure_file_priv%';NULL 表示限制mysql 不允许导入或者导出
修改mysql配置文件my.cnf 或 my.ini,在[mysqld]内添加
secure_file_priv =
(secure_file_priv的值没有具体值时,mysqld的导入或导出不限制文件目录)
或者
secure_file_priv = 指定目录 (限制mysqld 的导入或导出只能在指定目录下)
重启mysql,再次查看
导出的时候记得 windows路径 用 / 分隔目录
ok
---------------------
作者:dongsir 董先生
来源:CSDN
原文:The MySQL server is running with the --secure-file-priv option
版权声明:本文为博主原创文章,转载请附上博文链接!
这个是限制了导入导出目录,或者禁止了导入导出。
mysql中执行一下下边语句,查看 secure-file-priv
show variables like '%secure%'如果是一个路径的话,导入导出的文件路径放在这个路径下
如果是NULL,就要对secure-file-priv进行设置
本回答被提问者和网友采纳试下如下解决方法:
停了mysql的服务。
在类似的这个位置C:\ProgramData\MySQL\MySQL Server 5.6\my.ini, 找到INI文件。复制一份作为备份。
编辑此文件。将里面的类似的一行 secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.6/Uploads" 删除。
启动mysql服务。