如何处理MySQL服务器正在使用--secure-file-priv选项运行,因此它无法在Mac上执行此语句 [英] How to deal with The MySQL server is running with the --secure-file-priv option so it cannot execute this statement on a Mac
问题描述
我希望在mySQL 5.7.17上关闭secure-file-priv.我曾尝试过其他建议,以将secure-file-priv ="添加到my.cmf中,但是之后,mySQL拒绝启动:
I'm looking to turn off secure-file-priv on mySQL 5.7.17. I've tried other suggestions for adding secure-file-priv="" to my.cmf, however mySQL refuses to start up afterwards:
bash-3.2# mysql
mysql: [ERROR] unknown variable 'secure-file-priv='
bash-3.2#
其他帖子建议使用secure_file_priv,但我从mySQL得到了相同的响应:未知变量.
Other posts suggested secure_file_priv in stead but I get the same response from mySQL: unknown variable.
我也曾尝试将--secure-file-priv=/path/to/folder
添加到mySQL的启动守护程序中,但是却遇到了同样的错误.
I've also tried adding --secure-file-priv=/path/to/folder
to mySQL's launch daemon, but I get the same error.
有人知道如何在Mac版本的mySQL上关闭此繁琐功能吗?
Does anyone know how to turn this cumbersome feature off on the Mac version of mySQL?
谢谢!
推荐答案
我遇到了此错误.
它是在错误的部分中导致变量的.
It was caused to variable in the wrong section.
仅在[mysqld]
下有效:
[mysqld]
secure_file_priv="/home"
此外,我注意到,当我尝试将其设置为空字符串时,它不起作用-仅当它具有实际路径时,它才起作用
Also, I noticed, that it wasn't working, when I tried to set it to empty string - it only worked, when it had actual path
这篇关于如何处理MySQL服务器正在使用--secure-file-priv选项运行,因此它无法在Mac上执行此语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!