MySQL - The MySQL server is running with the --secure-file-priv option

今天尝试使用 into outfile 导出数据的时候出现错误:

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

上网查了一下,应该是 MySQL 设置的权限,可以使用

# 查看 secure-file-priv 当前的值是什么
show variables like '%secure%'; 

导出的数据必须是这个值的指定路径才可以导出,默认有可能是NULL就代表禁止导出,所以需要设置一下。

知道MySQL安装路径下的my.ini文件,设置一下路径。

然后重启数据库即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章