Latest news from 5wire Networks

Database Connection Problems – User modsec /etc/cron.hourly/ on cPanel

Database connection problems with are usually caused by an issue with mod_security. You will receive an email an hour such as the below, informing you that there is a problem with the service.

/etc/cron.hourly/  DBI connect('modsec:','modsec',...) failed: Access denied for user 'modsec'@'localhost' (using password: YES) at /etc/cron.hourly/ line 20 Unable to connect to mysql database at /etc/cron.hourly/ line 20.

The resolution to enable connectivity is straight forward. To double check there is an issue with connectivity, in SSH type –


If it is working, it won’t throw out any error….. If not, you will see a DBI connect failure message. What we need to do this, grab the password for the service from /etc/cron.hourly/

nano /etc/cron.hourly/

You will see the dbpassword line with the password, copy this into a local text document –

my $dbpassword = 'r7asda2YPnPJ1';

Now you will need to load up mysql, in SSH type

mysql mysql

We then update the password for user modsec with the password we collected from the file

mysql > update user set Password=password('r7asda2YPnPJ1') where User='modsec';

Flush the privileges

mysql > flush privileges;

And all done!

mysql > quit; To check modsecparse is now running, type the below into the command line

/etc/cron.hourly/ If no errors show, modsecparse is back up and running again!


Life time discount when you purchase your first order. Applies to Web Hosting, Reseller Hosting, and Cloud Servers.

Free Domain included on yearly Web Hosting plans.

Use code WEBOFF at the checkout!

Terms and Conditions apply. Voucher code is only valid for new customers.