打开网站显示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
问题:执行 LOAD DATA INFILE/SELECT ... INTO OUTFILE 时提示因 secure-file-priv 配置无法执行
原因:MySQL 的 secure-file-priv 参数限制了导入导出文件的目录,指定的文件路径不在允许范围内
解决方案:
1. 执行
SHOW VARIABLES LIKE 'secure_file_priv'; 查看允许的目录;2. 将文件放到该目录下再执行导入导出;
3. 修改 my.cnf 添加
secure-file-priv=/自定义目录(重启服务生效),或设为 secure-file-priv='' 取消限制(不建议生产环境)
扫码添加技术【解决问题】
专业解决各种疑难杂症,您有任何问题都可联系我们技术人员。
本文来自博客园,作者:可有仙子迎风立,转载请注明原文链接:https://www.cnblogs.com/xztime/p/19704693

浙公网安备 33010602011771号