The MySQL server is running with the --secure-file-priv option so it cannot execute

报错内容:The MySQL server is running with the --secure-file-pri option so it cannot execute this.

报错原因:mysql文件的导入和导出路径有默认的设置,即 secure-file-priv,当传入或传出的csv文件路径与默认的路径冲突时就会报错。

解决办法:

    打开my.cnf文件:vim /etc/my.cnf

    

 

 

      在my.cnf 文件中添加一行内容:secure-file-priv=""

    重启mysql:service mysqld restart

    进入mysql:mysql -uroot -p

    输入密码:********

    查看secure-file-priv设置:show variables like '%secure%'

    此时显示如下,secure_file_priv 的值为空:

    

 

     表示已修改成功。

posted @ 2019-10-30 13:18  那就墨丘利  阅读(3391)  评论(0编辑  收藏  举报