当前位置:Gxlcms > 数据库问题 > Mac配置Mysql遇到的 --secure-file-priv问题

Mac配置Mysql遇到的 --secure-file-priv问题

时间:2021-07-01 10:21:17 帮助过:124人阅读

1.安装mysql

在官网上安装,一步步无障碍安装(但根据后来文件入法导入/导出的经验,最好在安装前设置secure-file-priv为empty,5.7.6之后似乎就默认为NULL,而secure-file-prive为NULL的话,就不支持文件导入/出)

2.安装navicat premimum

在网上找到一个破解版,按照破解步骤来安装,很好用

3.遇到的问题:在将选择的记录导出到.csv文件时,出现提示“The MySQL server is running with the --secure-file-priv option so it cannot execute this statement”.

解决步骤:

(1)查询变量:mysql -> show variables like ‘%secure%‘,发现我的secure-file-priv的value为NULL。如果是一个文件路径的话,导入/出的文件路径放在这个路径下就可以,但如果是NULL,就要对secure-file-priv进行设置。

(2)我的系统为OS Sierra 10.11.6,在mysql文件夹下找不到my.ini文件(Windows系统应该有这个),只在/usr/local/mysql-5.7.16-osx10.11-x86_64/support-files中找到一个my-default.cnf配置文件,就把它复制了一份,并打开该文件,添加了如下图所示的那个语句,将它另存为“my.cnf”文件。但这个文件放在这个文件夹中并不起作用,我就把它复制到/private/etc中,就好了。注意??配置文件弄好之后要重启mysql服务器,才能有效。技术分享

Mac配置Mysql遇到的 --secure-file-priv问题

标签:sierra   oca   exe   statement   not   安装   ann   -o   5.7   

人气教程排行