Can't connect to local MySQL server through socket


May 24, 2006
Although I have three servers, I'm trying to set this one up on my own. And perhaps it's cut and dry for some, there are so many buttons and sections to choose from to find a solution to some issues.

I've setup the server (so I thought) but now each hour I'm being emailed by Cron Daemon (I'm sure Cron is a nice guy but he isnt giving me the solution) Anyhow the error the Daemon is sending is:


DBI connect('modsec:localhost','modsec',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /etc/cron.hourly/ line 18

If anyone has a solution for me I'd really appreciate it. I do need to figure this out but my time is so limited right now.

To give a breif history of the server setup. I didnt do anything out of the ordinary, and for all I know I may have missed something. This morning a message was at the top of my cpanel saying something about the mysql version and to "click here" to do something.

Heres the notice:

Important Notice: Incompatible versions of Mysql 4.0.x and NPTL based systems.
If you are running a newer linux system which is NPTL based (CentOS 4, Fedora 3+, RHE 4, etc) and are having problems with MySQL 4.0.x (versions later then 4.0.23*), we recommend upgrading to MySQL 4.1.x as we have determined that there are compatibility issues on these platforms. You can easily upgrade to 4.1.x by changing the Mysql Version in Tweak Settings
If you are worried about compatibility with MySQL 4.0, be sure to check the box labeled: Use old style (4.0) passwords with mySQL 4.1. in Tweak Settings.
If you are unsure if your system is NPTL based, run getconf GNU_LIBPTHREAD_VERSION at the command line and see if it displays NPTL.
* 4.0.23 does not have any known issues, but is subject to security vulnerabilities:,

Well i clicked on tweak settings and brought it to version 5. and tried both "Use old style passwords" and without.

Does any of this makes sense to someone here ?

Thanks in advance.



Well-Known Member
Feb 23, 2007
Also once you do that, you need to make a slight change.
pico /etc/cron.hourly/
go to the $dbpassword= line and get your password. Then,

pico /usr/local/cpanel/whostmgr/docroot/cgi/addon_modsec.cgi
and make sure that the password for $dbpassword=" matches. If not, change it and save the file. Then it should show up fine for you.
As shown at

Hope it is ok. In my case it did good.