ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti on so it cannot exe

时间:2019-03-18
本文章向大家介绍ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti on so it cannot exe,主要包括ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti on so it cannot exe使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

Mysql导入csv文件时报错:ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti on so it cannot exe

原因:mysql导入导出文件只能在secure-file-priv该变量配置的指定路径下的文件才可以导入导出。

解决方法:

1、查看本地secure-file-priv变量配置

mysql窗口下,输入命令:

1

show variables like '%secure%'

可以看到显示出来的secure-file-priv配置是什么路径,此时把文件放到指定路径,再执行导入导出操作即可;

2、如果路径太难找,需要重设secure-file-priv,则在mysql安装目录下,找到my.ini文件,

找到secure-file-priv变量配置的地方,修改对应的值,然后重启mysql,此时把文件放到指定路径,再执行导入导出操作即可;

3、如果secure-file-priv为null,则在mysql安装目录下,找到my.ini文件,

在文件中加入:

1

secure_file_priv="E:/" 

变量的值可自行修改,这里配置为e盘。然后重启mysql,此时把文件放到指定路径,再执行导入导出操作即可;

 

注意:此处重启mysql的操作是:在:我的电脑--右键--管理--服务和应用程序--服务,下面找到Mysql,停止该程序,然后启动该程序,secure_file_priv配置才生效