晴泪 2021-12-31 18:28 采纳率: 66.7%
浏览 82
已结题

MySQL server is running with the --secure-file-priv option so it cannot execute this statement

问题遇到的现象和发生背景

用代码导出MySQL数据报错

问题相关代码,请勿粘贴截图

```sql
<e>查询:select * from table_a INTO OUTFILE 'C:/Users/Administrator/Desktop/runoob.txt'

错误代码: 1290
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

###### 运行结果及报错内容 
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
###### 我的解答思路和尝试过的方法 
尝试过这个网址的解决方法,在MySQL的配置文件里面的my.ini文件里面没有看到有这个属性,我就自己添加上去了

```sql
# 导入导出数据路径
secure_file_priv="C:\Users\Administrator\Desktop"

重启了一下服务跟SQLyog一样没有效果


```sql
SHOW VARIABLES LIKE '%secure%';



![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/670324649046191.png "#left")


###### 我想要达到的结果
解决问题
  • 写回答

2条回答 默认 最新

  • DarkAthena ORACLE应用及数据库设计方案咨询师 2021-12-31 21:58
    关注

    改成这样试试

    secure-file-priv = ""
    

    或者

    secure-file-priv = 
    

    注意等号前后有空格

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 1月6日
  • 已采纳回答 1月4日
  • 创建了问题 12月31日