mysql-forgiving-mode

Permanently Set MySQL to “Forgiving” Mode [Using WHM & cPanel]

Written by | Date Updated: October 22, 2022

mysql-forgiving-modeIn 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:

  1. Go to and login to your Web Server’s cPanel (typically accessible by adding cpanel to your domain name — https://example.com/cpanel)
  2. Click phpMyAdmin
  3. Click “Server: localhost | Variables”
  4. 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)
  5. Use the Edit Button to erase everything in the sql mode dialog box

mysql-strict-mode-settings

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]

  1. Log into WHM with root access
  2. Find and click where it says terminal on the left
  3. whm-terminal

  4. In this terminal box, type the following:  nano /etc/my.cnf
  5. Then, under [mysqld] type (with the quotes as you see in the photo below):  sql_mode=””

    sql-mode-empty

  6. Then, press CTRL+O to save and CTRL+X to exit (read more about Nano basic editing here).
  7. Finally, within WHM, click the SQL Server tab and click to reboot your MySQL server as you see in the photo below:

    restart-mysql

  8. And that is how you permanently reset your MySQL server to forgiving mode.

    Hope this helps some of you out there.

    Cheers,  Richard

    Richard Cummings

    Director of SEO, Social Media, and Web Content Development at The SEO System
    Richard Cummings has been practicing online marketing for many years and has setup and optimized hundreds of WordPress sites.He founded The SEO System to provide SEO, social media, and online marketing services and software to businesses.
Richard CummingsPermanently Set MySQL to “Forgiving” Mode [Using WHM & cPanel]