Skip to content

Instantly share code, notes, and snippets.

@cucxabeng
Created April 6, 2017 15:48
Show Gist options
  • Save cucxabeng/938b55b3e8b8f1bf230edbf043254189 to your computer and use it in GitHub Desktop.
Save cucxabeng/938b55b3e8b8f1bf230edbf043254189 to your computer and use it in GitHub Desktop.
Config disable strict SQL mode for a Homebrew-installed MySQL server
  1. Find config file:
mysqld --help --verbose | grep my.cnf

In my case, it's locate at: /usr/local/etc/my.cnf, show content and find config directory path.

  1. Create new file at this path:
/usr/local/etc/my.cnf.d/disable_strict_mode.cnf
  1. Enter two lines:
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  1. Restart mysql:
brew services restart mysql
@rtrzebinski
Copy link

Thank you!

This helped me with mysql@5.7 and using home folder my.cnf override:

// MYSQL relax sql mode
$ touch ~/.my.cnf
$ vim ~/.my.cnf
insert this ===>>>
[mysqld]
sql_mode = ""
<<<===
$ brew services restart mysql@5.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment