I installed mysql with homebrew with this guide https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e
Now I need to delete the server variable NO_ZERO_DATE from the mysql configuration but i don't found mysql conf file. Where is located this file?
In MacOS the my.ini file is found as my.cnf, you can look for it in terminal with
> mysql --help
"Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf"
But if you hadn't found the cnf in the locations that help show you, try with the next command
> ls $(brew --prefix mysql)/support-files/my-*
For example, I got this file
/usr/local/opt/mysql/support-files/my-default.cnf
then you need to copy this file to one of your default directories, in my case /etc/my.cnf
> sudo cp /usr/local/opt/mysql/support-files/my-default.cnf /etc/my.cnf
Finally open your cnf file and delete STRICT_TRANS_TABLES from sql_mode
> nano /etc/my.cnf
sql_mode=NO_ENGINE_SUBSTITUTION
Exit with ctrl+x and press S
Don't forget to restart your mysql server
> sudo mysql.server stop
> sudo mysql.server start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With