Hello everybody I wanted to find this mysql strict mode for whmcs and disable it but i didn't had a progress I'm a newbie so sry if I didn't mention other things Can anyone help me? I'm working on WHM/Cpanel
SHOW VARIABLES LIKE 'sql_mode'; If result has "STRICT_TRANS_TABLES", then it's ON. Otherwise, it's OFF. If on then for what modes and how to off.
Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE . A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range.
You can also enable or disable InnoDB strict mode at run time with the statement SET [GLOBAL|SESSION] innodb_strict_mode= mode , where mode is either ON or OFF . Changing the GLOBAL setting requires the SUPER privilege and affects the operation of all clients that subsequently connect.
To turn off (or on) mysql strict access from cpanel.
1, search for 'phpmyadmin', in the search box, click on it
2, once phpmyadmin is loaded up, click on the 'variables' tab
3, search for 'sql mode'
then
to turn strict mode on enter
STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
to turn strict mode off, enter
NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
If you have control of the script you'll be using then it's a good idea to leave strict mode on, it'll alert you to any bugs in your code before they become an issue down the line.
I currently run a Centos 6.9 server with MariaDB and a multi-cpanel configuration, so for clients, they were unable to disable strict on their own without getting a lack of permission error. This is how you disable it globally:
# mysql -e "SELECT @@sql_mode;"
+----------------------------------------------------------------------+
| @@sql_mode |
+----------------------------------------------------------------------+
|STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, |
|NO_ENGINE_SUBSTITUTION |
+----------------------------------------------------------------------+
vim /etc/my.cnf
Strict Mode Enabled:
sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Strict Mode Disabled:
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
/etc/init.d/mysql restart
# mysql -e "SELECT @@sql_mode;"
+--------------------------------------------+
| @@sql_mode |
+--------------------------------------------+
| NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
Done :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With