Cybernet Web Design - Web Design & Linux Server Administration
How To Disable MySQL Strict Mode - Printable Version

+- Cybernet Web Design - Web Design & Linux Server Administration (https://www.cybernetwebdesign.com)
+-- Forum: Web Server (https://www.cybernetwebdesign.com/Forum-Web-Server)
+--- Forum: Server Problems (https://www.cybernetwebdesign.com/Forum-Server-Problems)
+--- Thread: How To Disable MySQL Strict Mode (/Thread-How-To-Disable-MySQL-Strict-Mode)



How To Disable MySQL Strict Mode - cybernetwebdesign - 01-24-2017

[Image: MySQL-Database.jpg]
In this tutorial we will show you how to disable MySQL strict mode on your CentOS 7 server. For those of you who didn’t know, 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.This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step turn off or to disable the MySQL strict mode on a CentOS 7 server.

Open the file with your favorite command line editor. In this example, we use ‘nano’:
 
Code:
nano /etc/my.cnf

Find the following lines:
 
Code:
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

If you find a line similar to the above that is setting the 
 
Code:
sql_mode
 
variable then you will need to replace it with the following line to disable MySQL strict mode:
 
Code:
sql_mode=""

Finally, Restart MySQL with this command:
 
Code:
systemctl restart mysql

To verify that the process was completed properly you can run the following:
 
Code:
mysql -e "SELECT @@sql_mode;"

The output may look similar to the following:
 
Code:
+--------------------------------------------+
| @@sql_mode
+--------------------------------------------+
| NO_AUTO_CREATE_USER
+--------------------------------------------+

Congratulation’s! You have successfully disable the MySQL strict mode. Thanks for using this tutorial for turn off or to disable the MySQL strict mode on CentOS 7 system. For additional help or useful information, we recommend you to check the official MySQL web site.