Random error establishing connection to database on 3 websites

Jun 1, 2020
6
0
1
Oldham, England
cPanel Access Level
Reseller Owner
Hello

On 3 websites I have running on a WHM server using cPanel over the last few weeks I have an "error establishing connection to database".

This error has appeared out of the blue with nothing being done to any of the websites as they are all brochure sites..

They instantly fixed themselves when I went into the control panel and repaired database.

Would anyone know what the possible causes may be for this as this has never happened before.

Also are there any logs I can access which will give me more indication of the original problem and where do I find these?

Many thanks,
William
 

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
51
103
Houston
cPanel Access Level
Root Administrator
Hello digitalrefresh! As you've already managed to resolve the error, identifying the root cause of the issue may be difficult. You can check the MySQL error log for errors mentioned when you experienced the database connection errors. You should be able to locate your MySQL error log location using the following command:

grep error /etc/my.cnf

I hope that this helps! If you have any other questions or concerns, please let us know.

Best regards,