How can I stop mySQL permanently and completely?

khiltd

Member
Apr 18, 2010
13
0
51
I am running cPanel 11.25.0-R44718 - WHM 11.25.0 - X 3.9

I don't need mySQL and don't want it chewing up memory. Unfortunately, while WHM allows me to turn it off in the Service Manager, cPanel acts like it has no idea this is even possible.

Problem #1: "LeechProtect"

Even though I've turned this off in the Feature Manager, cPanel still insists on inserting

Code:
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
into my httpd.conf file, and this mystery tool of dubious value blindly assumes it's going to be able to make a mySQL connection. Easy enough to comment out, but it keeps getting regenerated.

Problem #2: "modsecparse.pl"

I do run mod_security, and for whatever reason, cPanel has another utility of dubious value in /etc/cron.hourly/modsecparse.pl which strives to duplicate the contents of my mod_security logs in a mySQL database, again, blindly assuming that one exists. I don't want my logs duplicated in a database, and I don't want this job running. Easy enough to delete, but it too is regenerated.

Problem #3: "optimizefs"

Every so often, a cron job runs which tests to see if /usr/local/cpanel/bin/optimizefs exists and is executable, and then executes it. I have no idea what this tool does because it is actually compiled rather than interpreted, but I do know that I get an email every time it runs because it can't find a mySQL database to talk to. This is obnoxious and silly.

So my questions are: what happens to my machine if I simply disable "optimizefs," and why isn't any of cPanel's code written to handle the situation correctly by checking to see if mySQL is actually available before trying to connect to it and logging nonsense to stderr when it fails? Is there a way to actually turn mySQL off that works, or do I have to go delete all this stuff every single time I update?
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
There is just so many system processes that require MySQL and very nearly every web script and application out there needs it as well so it would be absurd to try to remove MySQL from the system.

If you are dead set on not having MySQL (not recommended) then I would suggest you fallback to a basic Apache / Linux setup without Cpanel.
 

khiltd

Member
Apr 18, 2010
13
0
51
There is just so many system processes that require MySQL and very nearly every web script and application out there needs it as well so it would be absurd to try to remove MySQL from the system.
Can you name one system process that requires mySQL?
 

khiltd

Member
Apr 18, 2010
13
0
51
For the Googlers: "cPanelTM 11.25 uses /usr/local/cpanel/bin/optimizefs to disable the atime attribute for a specific list of files and directories."

Translation: optimizefs does nothing of any particular value and probably doesn't actually need mySQL for anything but we paid someone to write it so we're gonna ship it no matter what.