Introduction
cPanel offers support for the basic configuration that we provide with the database and problems that might have occurred as a result of a defect in our software. General database problems and errors are best handled by a database administrator with the skills, training, and expertise required to do so for you.
Below are some of the first steps you can take to diagnose problems with your MySQL or MariaDB database.
Procedure
Check the status of the database with the following commands:
/scripts/restartsrv_mysql --status
/scripts/restartsrv_mysql --check
If the database is down, you can see any recent indications about why it has been failing to start:
journalctl -xe
Review the MySQL log to determine when the problem started, and what the problem is. You can find the location of the log by:
1. Checking the configuration file:
grep log-error /etc/my.cnf
2. Check the default location:
/var/lib/mysql/server.hostname.err
3. Check the value of the configuration variable:
mysql -e "show variables like '%log%';"
Check the messages log for issues that correspond with the time that the problem started in the MySQL log:
/var/log/messages
You may also find related information in the dmesg buffer:
dmesg | less
These are the locations to start looking for information. What needs to be done next is highly dependant on what is found in those data sources. Performing research at each point in the process is essential.
If you encounter InnoDB corruption, we have a guide that explains the process of identification and recovery: