CPanel server management and support

MySQL server being offline can cause a variety of issues for website and application owners who rely on the database to store and retrieve data. If your cPanel MySQL server is currently offline, there are a few potential causes and solutions to consider.

One possible cause of a MySQL server being offline is a configuration issue. This could be due to a problem with my.cnf file, which contains the settings for the MySQL server. If this file is corrupt or contains incorrect settings, the server may not start up properly.

Another potential cause of a MySQL server being offline is a problem with the database itself. This could be due to a corrupt table, a problem with the database’s file permissions, or an issue with the database’s storage engine.

A third possibility is that the server running the MySQL service is running out of memory or resources. This is more common on shared hosting plans where multiple sites share the same server.

To resolve the issue of a cPanel MySQL server being offline, you can try the following steps:

  1. Check the error log in cPanel to see if there are any specific error messages related to the MySQL server.
  2. Check my.cnf file for any issues and correct any errors you find.
  3. Run a check and repair on the database using the MySQL repair tool.
  4. If you suspect the server is running out of memory or resources, contact your hosting provider to discuss upgrading your plan.
  5. If none of the above steps resolve the issue, it may be necessary to restore the database from a backup.

It’s important to note that the cause of the issue can be complex and might require more advanced troubleshooting, it is always better to contact the hosting provider for further assistance.

The MySQL server is currently offline.

Error while connecting to MySQL: #28000Access denied for user 'root'@'localhost' (using password: YES)

Go to WHM > Service Manager and uncheck monitor for MySQL (so it doesn’t restart while fixing the issue), then save the area

2. Stop MySQL in root SSH (if it is running, if not running at all, then this can be skipped)

Code:

/etc/init.d/mysql stop

3. Start MySQL without the password prompt

Code:

mysqld_safe --skip-grant-tables &

4. Get a copy of the current MySQL root password

Code:

cat /root/.my.cnf

Copy down what it shows for the password.

5. Log into MySQL command line in root SSH and reset the password

Code:

mysql -u root
\u mysql
update user set password=("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit

Please replace NEW-ROOT-PASSWORD above with the actual password copied from /root/.my.cnf earlier.

6. Restart MySQL and check it’s working

Code:

/etc/init.d/mysql start
mysqladmin proc

If you can get a return of the processes, it’s working (not to mention it would have started properly at that point to show it’s working).

7. Re-enable monitoring in WHM

Back in WHM > Service Manager, re-check monitor box for MySQL and save the area.

By anup

Leave a Reply

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