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%'; 

MySQL - The MySQL server is running with the --secure-file-priv option_第1张图片

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

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

MySQL - The MySQL server is running with the --secure-file-priv option_第2张图片

然后重启数据库即可。

MySQL - The MySQL server is running with the --secure-file-priv option_第3张图片

你可能感兴趣的:(#,MySQL)