The MySQL server is currently offline. Mysql::initcache() failed: The mysql server is offline.

I was getting below error while accessing MySQL Databases from cPanel though MySQL service was running on server -
The MySQL server is currently offline.
Mysql::initcache() failed: The mysql server is offline.

Solution :-

1. Restart MySQL on server -

WHM >>Restart Services >> SQL Server (MySQL) >> Are you sure you wish to restart this service? >> Yes
OR
service mysql restart
OR
/etc/init.d/mysqld start

2. Reset MySQL root password - ( It's stored in '/root/.my.cnf', which cPanel updates when you change the password.)

1. Stop the MySQL running on server - service mysql stop
2. Start the MySQL without password - mysqld_safe --skip-grant-tables &
3. Connect to MySQL server as the root user - mysql -u root
4. Now reset new password for MySQL's root user -
mysql> use mysql;
mysql> update user set password=PASSWORD("New_Root_-Password") where User='root';
mysql> flush privileges;
mysql> quit
5. Stop and restart the MySQL service.

Let me know if you've any thoughts.
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to reset SSH port back to default port 22?

In some situations most of us may come across a problem that we are able to log into the WHM but...

How to setup the root login alert notification email?

Its very important to keep a check on your servers and who logs into the server, From security...

How to enable Open SSL on WHM?

Before enabling open SSL, you can check whether it is already enabled on your server. Please fire...

How to install mod_pagespeed on WHM?

'mod_pagespeed' is module of Apache which is nothing but plugin which is used for compressing the...

How to enable Hot Link Protection in cPanel?

To avoid other sites to use your website's bandwidth, you can enable the hot link protection....

Powered by WHMCompleteSolution