美文网首页数据库知识点MySQL
mac__MySQL导出数据遇到secure-file-priv

mac__MySQL导出数据遇到secure-file-priv

作者: tobbyvic | 来源:发表于2018-03-21 22:14 被阅读11次
cyclist-3202481_640.jpg
  • 在mysql中导入文件时报错
ERROR 1290 (HY000): The MySQL server is running with the –secure-file-priv option so it cannot execute this statement.

这个时候在网上查了一下,需要通过指令看一下secure-file-priv的配置

show variables like '%secure%';

看到为null


image.png

在网上查了一下需要在my.cnf中更改secure-file-priv的配置

  • 开始寻找my.cnf这个文件
    文件路径在
/usr/local/etc/my.cnf

打开编辑


image.png

果然没有secure-file-priv的配置,然后在网上看了一下,要在mysqld下面更改,注意!!要在mysql.server stop之后才能更改保存,就更改为这样子:

image.png
最后再mysql.server start
show variables like '%secure%';
image.png

成功了!!!!
如果对大家有帮助的话,记得点个赞哦~~

相关文章

网友评论

  • 落幕12:你好,为什么我按照这个来一直都是NULL没有变化?

本文标题:mac__MySQL导出数据遇到secure-file-priv

本文链接:https://www.haomeiwen.com/subject/wkmiqftx.html