How To Disable MySQL Strict Mode
Since MySQL version 5.7, strict mode was enabled by default. MySQL Strict Mode stipulates how your MySQL server will handle invalid requests in code. In previous versions, MySQL would ignore these values as much as possible. This affects the following MySQL and MariaDB versions
- MySQL 5.7
- MySQL 8.0
- MariaDB 10.3
- MariaDB 10.4
- MariaDB 10.5
The Problem With Strict Mode
Having strict mode enabled means if you have an outdated script or a script that was using previously valid syntax your program or script will cease working. This has caused many problems for users. By having this mode enabled for new installs and upgrades programs that run fine previously ceased to work until strict mode was disabled.
MySQL can be set to operate in different SQL modes and these modes can be set on a per-server or per-client basis. In this guide, we will disable MySQL Strict Mode server-wide.
Note- New installs of cPanel now automatically disable strict mode.
Disable MySQL Strict Mode
Log in as the root user to your server and find you’re my.cnf file for MySQL, it’s usually located at /etc/my.cnf
At the bottom of this file place the below code and save the document
Now, restart your MySQL server and strict mode will be disabled. There are some security concerns when disabling strict mode and you should check with your developer that any programs you run are secure. Whilst strict mode is inconvenient for many users it also does serve a purpose.
How was this article? – MySQL Strict Mode
You might also like
More from All About Linux
Open And Close Ports In FirewallD - Manage Zones In FirewallD Like IPtables, FirewallD is a Linux firewall that filters packets …