MariaDB Strict Mode for single cPanel Account

HowardE

Member
Aug 8, 2015
20
2
53
Florida
cPanel Access Level
Root Administrator
Hello.

Is it possible to disable mysql strict mode for a single cPanel account and not globally on the entire server? I have a single account where the site owner is complaining that STRICT_MODE is causing issues with their application. My response is that the developer of their app should check their code and figure out where the issue is and fix it, rather than make a global change to my server where the other 300 databases have no issues whatsoever.

Any other thoughts on my stance on this are welcome as well...

To try and make this work, I've tried setting up a .my.cnf file in the root of the account in question. This doesn't seem to do anything.

I'm using WHM 84.0.20 on CENTOS 7.7 and MariaDB 10.3.

Thanks.
Howard
 

rackaid

Well-Known Member
Jan 18, 2003
89
28
168
Jacksonville, FL
cPanel Access Level
DataCenter Provider
Howard
The .my.cnf file would only apply to MySQL client connections made from the command line. However, you can set the sql_mode on a per-session basis.

Code:
SET SESSION sql_mode = 'modes';
Where 'modes' is the desired SQL mode.

The application would need to run the above SQL query before other queries. If modifying the application is not possible, I do not know of another way to selectively disable the sql mode on a per-user basis.

I find the MySQL docs do a better job of explaining modes than MariaDB's.
 
  • Like
Reactions: cPanelLauren