1. Home
  2. Helpful Tips
  3. How to Turn Off MySQL Strict Mode

How to Turn Off MySQL Strict Mode

When I upgraded to Ubuntu 16.0x, some of my older apps began breaking. MySQL 5.7 uses stricter query rules that break some applications (that might have security flaws).

Here’s how to turn off strict mode. Create a helpfully named .cnf file:

sudo nano/etc/mysql/conf.d/disable_strict_mode.cnf

Add these 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

And restart MySql, and that’s it:

sudo systemctl restart mysql

Source I found it at grabbed it from ServerPilot. And, there’s a nice sql query test to tell you if it works there.

Updated on April 18, 2017

Was this article helpful?

Related Articles

Leave a Comment