365 Hosting support | Server Management Provider

365hostingsupport ultimate source of Server Security, cPanel server management and monitoring. Since 2012 we are offering top class technical support services at lowest prices. We offer 100% Satisfaction with 7 Days Money Back Guarantee.

365 Hosting support |  Server Management Provider - 365hostingsupport ultimate source of Server Security, cPanel server management and monitoring. Since 2012 we are offering top class technical support services at lowest prices. We offer 100% Satisfaction with 7 Days Money Back Guarantee.

Disable strict mode on MySQL / MariaDB

Disable strict mode on mysql / MariaDB

How do I disable MySQL strict mode on the server?

MySQL strict mode

MySQL strict mode

Error : 

 

“My SQL Error 1048 column description cannot be null”
“mysql error : Incorrect integer value “

These error normally comes when you trying to get some transaction on the database server. This can be fix in multiple ways in some case you will need to have root/admin level of access on database or  phpmyadmin access. Below are more detail steps to fix it in mysql.

Open the “/etc/my.ini” file on database server and look for something like…
# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Replace with:

sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

You may able to do it in another method by login into the phpMyAdmin, if you have cpanel you can login into the cpanel > Database section you will find option “phpMyAdmin”. You may be able to run an SQL query within your phpMyAdmin as shown below.

SET @@global.sql_mode= ”;

 

How do I disable Strict mode on MariaDB database server?

 

This example shows how to get a readable list of enabled SQL_MODE flags:

SELECT REPLACE(@@SQL_MODE, ',', '\n');
+-------------------------------------------------------------------------+
| REPLACE(@@SQL_MODE, ',', '\n')                                          |
+-------------------------------------------------------------------------+
| STRICT_TRANS_TABLES
NO_ZERO_IN_DATE
NO_ZERO_DATE
NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------+

Adding a new flag:

SET @@SQL_MODE = CONCAT(@@SQL_MODE, ',NO_ENGINE_SUBSTITUTION');

If the specified flag is already ON, the above example has no effect but does not produce an error.

How to unset a flag:

SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'NO_ENGINE_SUBSTITUTION', '');

How to check if a flag is set:

SELECT @@SQL_MODE LIKE '%NO_ZERO_DATE%';
+----------------------------------+
| @@SQL_MODE LIKE '%NO_ZERO_DATE%' |
+----------------------------------+
|                                1 |
+----------------------------------+

 

 

Remember one thing this is base on the studies we implement for our customers if this fix does not apply on your issue you can contact us to permanently solve your issue at   http://365hostingSupport.com