How to turn off MySQL strict mode?


Nowadays when I want to create a new user via phpmyadmin, I received this kind of error due to strict mode. Hence, I would like to share how to disable or turn off MySQL strict mode so you are able to create the user of the database.

Method 1:
Open “my.ini” file within the MySQL installation directory and look for something like
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Replace with:
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Method 2:
Run an SQL query within your database management tool such as phpMyAdmin which can normally be found from your web hosting control panel.
SET @@global.sql_mode= ”;


Comments