MySQL ERROR 1290 (HY000) --secure-file-priv option

后端 未结 9 1413
醉话见心
醉话见心 2020-11-30 03:19

I am trying to write the results of MySQL script to a text file using the following code in my script.

SELECT p.title, p.content, c.name FROM post p
LEFT JOI         


        
9条回答
  •  长情又很酷
    2020-11-30 03:41

    Just create a file /etc/my.cnf with the following content

    [mysqld]
    secure_file_priv            = ''
    

    You can use this oneliner:

    echo "[mysqld]\nsecure_file_priv\t\t= ''\n" | sudo tee /etc/my.cnf
    

    And then restart mysql. If brew was used to install the mysql run the following command:

    brew services restart mysql
    

提交回复
热议问题