cPanel Databases

How to disable MySQL strict mode on cPanel

disable MySQL strict mode
disable MySQL strict mode

How to disable MySQL strict mode on cPanel

Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. This post explains how to disable MySQL strict mode on cPanel.

Strict SQL mode is in effect if either STRICT_ALL_TABLES or STRICT_TRANS_TABLES is enabled: http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict

MySQL strict mode can be disabled by editing the line beginning with sql_mode in the [highlight color=”yellow”]/etc/my.cnf[/highlight] or [highlight color=”yellow”]/usr/my.cnf[/highlight] files.

 
vim /etc/my.cnf

Add the below entry in it.

 
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Please restart the MySQL service once the above entry added to the MySQL configuration file.

 
/etc/init.d/mysql restart

Then, test it by running the following command:

 
mysqladmin var | grep sql_mode

That’s it!

Also Read: How to Backup and Restore MySQL Databases

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Add Comment

Click here to post a comment

Topics