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’;
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;
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.
