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!

How to Disable MySQL Strict Mode

As for how to disable MySQL Strict Mode, namely,

1. Perform SSH access to the VPS

To access SSH to VPS, you can use PuTTy or Terminal. Please follow the VPS Remote Method .

2. Make Data Backups

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
}

3. Disable MySQL Strict Mode

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.

4. Restart the MySQL Service

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

5. Perform Strict Mode Checks

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.

 

Conclusion

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 !

What is Safelink Asia?

Safelink.asia is a completely free tool where you can create short links. URL security with cryptographic algorithm. Protect your web visitors with a secure link, to avoid viruses, malware, thief, etc. Apart from being free, you get paid! Register now!


Shorten URLs & earn money

So, now you can make money from home, when managing and protecting your links with Safelink Asia. Signup for an account in just 1 minutes. Once you've completed your registration just start creating short URLs and sharing the links with your family and friends. See our proof of payment and publisher rate.


Our partners and network

Here are some of our partners and networks that have collaborated on advertising: 401XD Group, MC Project, Kincai Media, Kartu Nama Digital, SEO Secret Indonesia, Safelink Asia, Media Bisnis, Blackexpo, Adigunawan.net.