My site frequently got error database connections problem


My site frequently got error database connections problem so i contact with hosting. They told me that as below:

Your database connection errors are caused by your user hitting the MySQL Max_Connection limit. This means something in your code such as a plugin or theme is not closing the connection properly. A normal MySQL connection takes a few milliseconds and there can be 15 at one time, but if the connection is not closed the account will hit the limit and display the error. You will need to try disabling plugins and changing the theme to track down the cause of the error.

Then i tried to re-name plugin + theme folder in order to stop Max_Connection error but it's still presits.

Then i tried to re-name again to default, now the site display "Stylesheet is missing." problem. I'm sure that the theme folder still exist at right location.

This is really the problem make me feel down since i can not access my site anymore. Could you try to access my ftp or database to find out what's happened? (i will provide the log-in details)

Thank you,

  • Milan

    Hello Tuan,

    Sorry to hear about your issue. :slight_frown:

    Would you be able to send in your FTP and wp-admin credentials so I could take a look more closely on this ?

    You can send the info through our private contact form:

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me :slight_smile:

    Send in:

    Subject: "Attn: Milan Savaliya"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Once we have this information then I can debug the issue further :slight_smile:

    Look forward to hearing back!

  • Adam Czajczyk

    Hello Khanh,

    I hope you don't mind me jumping in here for a while :slight_smile:

    I took a liberty of using access credentials that you sent to my colleague Milan and I checked your site.

    I noticed that inside "/wp-content/themes/" folder there's "alone" header.php file which is unnecessary there and actually it shouldn't be there so I removed it. The main issue however was this:

    there's a "/wp-content/themes/gadgetine-theme/ folder which is fine but instead of the theme files inside were two folders more - the "/gadgetine-theme/" and the "/gadgetinge-theme-child/". This breaks the theme folder structure that WP requires as both this folders should be placed directly inside the "/wp-content/themes" folder. Therefore I moved them there. I also removed the "old" folder as there was another copy of Gadgetine Theme inside which may be causing confusion. Finally, I had to manually clear WP Rocket cache. Now the site seem to be working fine.

    Currently the "Gadgetine Premium Theme" is enabled but if it should be the "Gadgetine Premium Child Theme" you may simply make a switch via dahsboard's "Appearance -> Themes" page.

    As for database connection error.

    It seems that the server you're using may be set to allow very limited number of db queries. This is often the case with shared hosting account. I'm not sure what are the actual parameters of it but I'd suggest starting with following "clean ups":

    1. make sure that WP core, all the themes and plugins are up to date
    2. review your plugins and try to limit their number (there may be plugins that you're not using at all or using very rarely so it may be good to remove them)
    3. try to find out more about current limitations of the server; this may require you to get in touch with your hosting provider. It may turn out that they'll be able to raise these limits and it will solve the issue. It is however worth knowing that some servers are simply not "ready" to handle complex WP sites and it may be necessary to move to another host.

    Best regards,

  • Milan

    Hello Khanh

    Hope you are well today and glad to know that you found Adam's help helpful. :slight_smile:

    Has your issue resolved ? If yes then please mark this thread as resolved one. Actually after marking resolved one, you don't need to reply us back here. But if issue is still there, please let us know so that we can move forward with further troubleshootings.

    For other issues, please consider opening new threads.
    Thanks for being with us. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.