How to Disabling MySQL Strict Mode properly in MySQL / MariaDB Configuration on a cPanel server. let’s get started
To determine the current global sql_mode value, execute the following command
[root@secure admin]# mysql -e 'select @@GLOBAL.sql_mode;'
+-------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode |
+-------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------+
Open the MySQL configuration file For cPanel servers, the location of the MySQL configuration file is “/etc/my.cnf” , Edit the sql_mode value within this file and remove any value if it has.
Restart the MySQL service
let see how it works
[root@secure admin]# mysql -e 'select @@GLOBAL.sql_mode;'
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
| |
+-------------------+
That’s it! You’ve just properly disabled MySQL Strict Mode