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
- Maria DB 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
Install Ioncube Loaders In Ubuntu, Debian, CentOS and AlmaLinux
Ioncube Loaders are a piece of software that is used to protect the underlying code in PHP applications. Its aim …
How to install FTP and configure FTP on an Ubuntu 22 LTS instance
If you need to upload files to your NVMe VPS you have a couple of options. You can use a …
How to install a Cloudflare Origin SSL Certificate – NGINX
An SSL Certificate is vital to encrypt data between you and your clients. SSLs can be complicated things. If they …