WordPress: "Error establishing a database connection"

by kalyn
4 replies
  • WEB DESIGN
  • |
Hello, I have a website that was doing quite well. The URL is http://japaneseemoticons.net and it was getting about 12k visits per day.

Recently I hired a guy from oDesk to help me out with some edits to the new theme I had installed. I've worked with him before and he's always been really good.

However this time something happened. When you visit the website you'll see a blank page that says "Error establishing a database connection".

I gave the guy from oDesk access to the database by setting up a new user through the BlueHost Control Panel. He apparently fixed the problem but then 5 minutes later it showed up again. He tried fixing it a second time and again the problem came back 5 minutes later.

Here's what BlueHost Support told me the problem was (none of this makes any sense to me):

"The problem is you are exceeding the database connection limits. Your site is maintaining persistent connections to the db. and each page load increments the number of processes your database user is using by one. You will need to

Database connections are limited to a maximum of 15 active connections at any instant of time from a given database username. You will need to optimize your database queries to run faster, and terminate correctly. Im sorry but this is not something we provide support for. ( Please see: https://my.bluehost.com/cgi/help/310 ) While we strive to do our best to help with any and all issues, at the end of the day we are not web developers. We can not provide support for third party code, or scripting. If you need further assistance you will likely need to contact a web developer. "


The guy I hired from oDesk is telling me he thinks I need to switch the hosting server to fix the problem. I don't know how to do that. He claims the rest of the site is still there so content wise and everything we're still good.

Has anyone encountered anything like this before? I have no idea what to do. I need to get the site back online ASAP and I'm willing to pay someone to fix it if necessary, I just need to know what to tell them to do.

Thanks in advance for any help!
#wordpress
  • Profile picture of the author UMS
    Do you have a caching plugin like W3 Total Cache, WP Super Cache or QuickCache installed?

    If not, do so promptly as this will significantly reduce the number of database calls when a user views a page.
    {{ DiscussionBoard.errors[7515813].message }}
    • Profile picture of the author kalyn
      Yeah, I had W3 Total Cache installed.

      Every time I go to the site I get the database error. If I go to http://japaneseemoticons.net/wp-admin/

      It says this too, so I can't log in to fix anything:

      Error establishing a database connection

      This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.
      • Are you sure you have the correct username and password?
      • Are you sure that you have typed the correct hostname?
      • Are you sure that the database server is running?
      If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
      {{ DiscussionBoard.errors[7515927].message }}
      • Profile picture of the author run
        Originally Posted by kalyn View Post

        Yeah, I had W3 Total Cache installed.

        Every time I go to the site I get the database error. If I go to http://japaneseemoticons.net/wp-admin/

        It says this too, so I can't log in to fix anything:

        Error establishing a database connection

        This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.
        • Are you sure you have the correct username and password?
        • Are you sure that you have typed the correct hostname?
        • Are you sure that the database server is running?
        If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
        The warning notification itself are to make sure you check 'em all. Again:

        - Access your wp-config.php and open it to make sure everything is correct because sometimes someone could access your wp-config.php and do some bad changes.

        OR

        - Back up your current theme and delete it from your current Wordpress site, so it roll back to the default theme. This is to make sure that the problem is not from the theme.

        OR

        - Create Fresh new database, export old databases file (don't delete old database) and import into new database. Make change to your wp-config.php to fit the new database meta.

        OR

        - Moving your site to another server as developer suggested!
        Signature
        I just wanna tell you that most of the links in the signature are trash and/or a trap to make you pay!
        {{ DiscussionBoard.errors[7516156].message }}
  • Profile picture of the author SteveJohnson
    I've seen this happen with poorly-written themes and plugins that use non-standard database queries - iow, queries using the WP database class instead of established WP functions. Many people don't know this, but the majority of WP queries are internally cached to reduce database overhead.

    You mentioned that this was a new theme. Did you have the same issues with your old theme? If not, then you have a place to start looking.

    None of the caching plugins will help if the theme or a plugin is causing this problem, because a page will never get completed so it can be cached.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[7515930].message }}

Trending Topics