Speaktech.in

Disable Strict Mode for MySQL 5.7 on Ubuntu

Disable Strict Mode for MySQL 5.7 on Ubuntu


Create a new .cnf file.

nano /etc/mysql/conf.d/strict_mode.cnf


Paste the following code into that file,

[mysqld]sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Save and close the file. And then restart MySQL server.

systemctl restart mysql

mysql -u root -p

SELECT @@GLOBAL.sql_mode global, @@SESSION.sql_mode session