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
Just create a file /etc/my.cnf with the following content
/etc/my.cnf
[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