Steps to disable mysql strict mode


Staff member
In mysql database 5.7 version strict mode is enabled but if you are getting issue or your application requirement is to disable strict mode then you can check this article.

Mysql mainly helps to handle missing or invalid values in data change statements (INSERT or UPDATE). If mysql strict mode is disabled then mysql will handle missing or invalid values by produces warning.

If you are getting below errors then you have to disable mysql strict mode.

This behaviour is due to Strict Mode being enabled in your MySQL server configuration.

Please disable MySQL Strict Mode in your server configuration in order for WHMCS to function correctly.
Critical: MySQL enables "strict mode" by default as of version 5.7. Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. Applications not built with strict mode enabled may cause undesired behaviour; please verify applications using MySQL are compatible before upgrading. More information about strict mode is available here.
  • Login to server with your SSH client.
  • Now you have to run below command to check the sql mode:
# mysql -e 'select @@GLOBAL.sql_mode;'
| @@GLOBAL.sql_mode |
  • If there is STRICT_TRANS_TABLES", available then it means strict mode is enabled on server., you have to disabled it then you can check below steps:
  • Now open my.cnf file on up /etc/my.cnf location with your text editor.
  • You have to search for sql_mode and if there is no sql_mode option then you have to add below line in end of file.
  • To reflect changes you have to restart MySQL service.
/scripts/restartsrv_mysql –force