MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方

搬运:

https://blog.csdn.net/baidu_33621692/article/details/76972288

https://blog.csdn.net/eagle89/article/details/80320016

#1、实测 可以用

错误:略(忘记截图了=-=)

效果:

SQL :

SELECT * INTO OUTFILE 'rrr.csv' FIELDS TERMINATED BY ',' FROM activity_base_info;

SELECT * INTO OUTFILE '文件名称 FIELDS TERMINATED BY ',' FROM `表名称`;


导出查询结果:Select语句 into outfile '保存路径+文件名';

导入查询结果:load data local infile '保存路径+文件名' into table `表名称` character set utf8;


MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第1张图片
文件导出


MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第2张图片
utf-8打开乱码


MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第3张图片
换个支持utf-8编码的工具打开


干活:

找到mysql配置文件文件--my.ini(文件位置默认见图片)

推荐使用everything搜索工具快速查找 

MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第4张图片
修改配置,文件路径做了什么


secure-file-priv=""#改成这个

csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option


解决方法:

  1.进入mysql查看secure_file_prive的值

  mysql>SHOW VARIABLES LIKE "secure_file_priv";

MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第5张图片

secure_file_prive=null--限制mysqld 不允许导入导出

secure_file_priv=/tmp/--限制mysqld的导入导出只能发生在/tmp/目录下

secure_file_priv=' '--不对mysqld的导入导出做限制

  2.修改secure_file_prive的值

windows下在my.ini文件 [mysqld]节点 下添加secure_file_priv='',然后重启mysql服务。

MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方_第6张图片

你可能感兴趣的:(MySQL提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方)