Home » WHM/cPanel » mod_security plugin could not connect to the database

mod_security plugin could not connect to the database

The mod_security plugin could not connect to the database. Please verify that MySQL is running. Error: Access denied for user ‘modsec’@’localhost’ (using password: YES)’

As per the error, the modsec user doesn’t have the correct password or privileges to access the database. The easiest way to find the current password for modsec is to simply check the file /etc/cron.hourly/modsecparse.pl and open /etc/cron.hourly/modsecparse.pl to find the following data:

my $dbhost = ‘localhost’;
my $dbuser = ‘modsec’;
my $dbpassword = ‘Password-Here’;
my $dbname = ‘modsec’;
my $tblname = ‘modsec’;

Use the password from $dbpassword and update it via MySQL command line:

[root@server]# mysql -u root -p
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD(‘Password-Here’) WHERE USER=’modsec’;
mysql> flush privileges;
mysql> exit;

Once completed, simply refresh your WHM page, and the issue should be resolved.

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud