Hi KincaiHostingns! In this tutorial, we will explain how to disable MySQL Strict Mode. Quoted from MySQL, strict mode will perform error control (invalid / missing value) on data changes such as insert, update or create tables. Errors in values can come from many factors, for example, the data type in the column is wrong or out of range. Well, sometimes MySQL Strict Mode makes the developer a little annoyed. When checked on the script, no error messages appeared. However, at the time of execution, the system function does not function properly. So that the insert and update process cannot be executed. So for that, you can anticipate this by disabling MySQL Strict Mode. Oh yes, at KincaiHosting, you can only disable MySQL Strict Mode on a VPS. Don't have a VPS yet? Come check out cheap VPS ! Starting from 100 thousand per month you can already get a VPS with the latest technology!
As for how to disable MySQL Strict Mode, namely,
To access SSH to VPS, you can use PuTTy or Terminal. Please follow the VPS Remote Method .
The second thing you have to do in this guide on how to disable MySQL Strict Mode is to make data backups. Please do data backup in the following way,
cp -a /usr/my.cnf(,.strict.bak} cp -a /etc/my.cnf(,.strict.bak
}
To disable MySQL Strict Mode, please do the following command,
/usr/my.cnf nano
nano /etc/my.cnf
Then search for,
sql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
To disable MySQL Strict Mode, please change it to,
sql_mode = ""
If so, don't forget to save it! For those of you who use the nano editor, to save the edited file, ctrl + x then press Y on the keyboard then Enter.
Now it's time to restart the MySQL service.
If you are using CentOS 7, please do the command:
systemctl restart mysql
or
/etc/init.d/mysql restart
If you are using Ubuntu, please do the command:
mysql service restart
or
/etc/init.d/mysql restart
After restarting, please check with the command,
mysql -e "SELECT @@ sql_mode;"
If the words " NO_AUTO_CREATE_USER" appear, it means that you have successfully disabled Strict Mode. That means, the guide on how to disable strict mode is complete.
For developers, don't worry! If your script doesn't run correctly, there may be several factors at play. One of them is MySQL strict mode. So, please deactivate it by following the guide on how to disable MySQL Strict Mode. Want to make your website and VPS more secure? Please install SSL on VPS by following the SSL Install Guide on VPS . If you have any questions, don't hesitate to send tickets to the KincaiHosting Support Team !