Skip to content

Instantly share code, notes, and snippets.

@eblumstengel
Created January 30, 2018 08:29
Show Gist options
  • Select an option

  • Save eblumstengel/b6a4ab3b5f874eb8702a0555e6a446db to your computer and use it in GitHub Desktop.

Select an option

Save eblumstengel/b6a4ab3b5f874eb8702a0555e6a446db to your computer and use it in GitHub Desktop.
MySQL 5.7 - Disable strict mode / set global sql_mode
Add a config to keep everything clean:
/etc/mysql/conf.d/disable_strict_mode.cnf
Set specific SQL modes:
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
OR simply:
[mysqld]
sql_mode=''
sudo service mysql restart
Test to confirm SQL mode setting:
SELECT @@GLOBAL.sql_mode;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment