In this post, I am going to show you how to temporarily and permanently reset your MySQL server from strict mode back to forgiving mode using WHM so that your old, legacy code will work once again.
What happened? What is MySQL strict mode and why are your “Updates” and “Inserts” no longer working?
MySQL 5.7 introduced a “strict” mode that forces better code [read more here] but often breaks legacy code. While your long term solution should be to improve your code, the short, rapid solution often necessitates that you set your server back to forgiving mode — you can literally solve thousands of problems with this quick solution.
Although our blog is primarily about online marketing strategies, we also manage the web servers of our clients and we hope this post helps you manage your web and MySQL server.
So let’s get to it.
How to Temporarily Set MySQL to Forgiving Mode
Many people believed that they had solved this problem with the solution below only to realize it was a temporary solution — it worked until a server re-boot.
Here is the method used to temporarily set your MySQL to forgiving mode using cPanel:
- Go to and login to your Web Server’s cPanel (typically accessible by adding cpanel to your domain name — https://example.com/cpanel)
- Click phpMyAdmin
- Click “Server: localhost | Variables”
- Find the Variable “sql mode” which probably looks like the yellow highlight in the photo below (all those “strict” settings are what’s messing up your MySQL queries)
- Use the Edit Button to erase everything in the sql mode dialog box
These 5 steps will set you back to MySQL forgiving mode and your code will work once again…until you have a server reboot.
How to Permanently Set MySQL to Forgiving Mode [Using WHM]
- Log into WHM with root access
- Find and click where it says terminal on the left
- In this terminal box, type the following: nano /etc/my.cnf
- Then, under [mysqld] type (with the quotes as you see in the photo below): sql_mode=””
- Then, press CTRL+O to save and ENTER to exit (read more about Nano basic editing here).
- Finally, within WHM, click the SQL Server tab and click to reboot your MySQL server as you see in the photo below:
- Google Analytics and Google Tag Manager Code:Do I Need Both? - September 19, 2020
- WordPress X Theme:How To Setup Google Tag Manager - September 17, 2020
- Permanently Set MySQL to “Forgiving” Mode [Using WHM& cPanel] - January 21, 2020
And that is how you permanently reset your MySQL server to forgiving mode.
Hope this helps some of you out there.