Jump to content

Critical Error. Could not connect to the database


Recommended Posts

Over the last day, I've had this error coming up:


Critical Error

Could not connect to the database


I'd love to give more info but that's all it says - is there any way of getting more info on exactly what the problem is?


I know that there's nothing wrong with the database because I use my own scripts to get data from the WHMCS database, using the same mysql login (I use it to display due invoices in the user control panel).


When I restart the mysql service, it starts working again.


This has got me slightly confused, why would WHMCS not be able to connect to the DB when I can connect fine with other scripts? And is there anything I can do to get a more useful error message when it happens again?


Thanks :D

Link to comment
Share on other sites



This is not WHMCS script issues nor WHMCS staff can solve this as its not related to WHMCS. The issue is with your Database and you need to contact cPanel Support staff if you are using it or check for MySQL logs whether any database is using too much CPU/Memory for run i said this because i am myself faced this issue few month before so find that database and optimize it.


Thank You,


Link to comment
Share on other sites



I did open a support ticket and they were very helpful and gave me a file to test the mysql connection. The error that came up was too many connections, so flush hosts is fixing it temporarily.


It seems strange though that other scripts are still able to connect to the same database using the same username/password.


It should be ok after tonight, I'm moving the database to a different server that I just use for mysql.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated