How to disable MySQL strict mode on Ubuntu 16.04

    MySQL has a strict mode in 5.7 as a default option. If you updated the Mysql to this version, your old version PHP apps maybe been broken.

    On MySQL 5.7, the default values for this key are:


    The strict mode comes from STRICT_TRANS_TABLES. So, let’s overwrite the sql_mode and set it to be the same as the default, but without strict mode.

    sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

    add the following line on section [mysqld]


    That’s it! Save the file, and restart MySQL.

    Related articles

    comments powered by Disqus