MYSQL导数据或安装网站出现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
先说一下 --secure-file-priv这个参数,它是用来限制LOAD DATA, SELECT OUTFILE, and LOAD_FILE()传到哪个指定目录的。
可以用show variables like '%secure%';这条命令搜索到这个参数的值
secure-file-priv参数默认是NULL,禁止导入与导出 所以导入导出的时候就报错了。
secure-file-priv值为NULL时 则禁止导入与导出
secure-file-priv值为空 时 则允许导入与导出
secure-file-priv值为路径时 则允许路径内导入导出,但是路径不包括子目录
修改mysql配置文件 如果没有这个参数就加一个 secure_file_priv=''
为了安全,导完后记得把mysql配置改回去。
留言(0)