Make MySQL 5.7+ behave like MySQL 5.6

Written in

by

You've upgraded your environment to MySQL 5.7 and everything is broken.

MySQL 5.7 includes a number of changes to the sql mode which are talked about here: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-changes

The old defaults can be set via the sql_mode property on a per-query basis or server wide via the my.cnf file.

To apply the old defaults:

  • Open your my.cnf (usually found at /etc/mysql/my.cnf )
  • Add a line under [mysqld] section. sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION
  • Close your file and restart mysql.

 

Thanks to Ian and Logan from Austin PHP for this solution.

Tags

Verified by MonsterInsights