Site is down: Error establishing a database connection

Site is down: Error establishing a database connection
http://cloudbestpractices.net

Bluehost told me I needed to repair and optimize the database, which I've done. Still down.

  • Sajid

    Hi Neil,
    Hope you are doing good today :slight_smile:

    If you have done the database repair and still getting this error then make sure the database connection details are correct and there are no even typo errors in wp-config.php file. That is the most important file in WordPress, if you or any one else changed database, username, password then make sure you update the values in wp-config.php file accordingly.

    These are the configuration constants for database connection. These are already in your wp-config.php file so just make sure they are correct.

    define('DB_NAME', 'database-name');
    define('DB_USER', 'database-username');
    define('DB_PASSWORD', 'database-password');
    define('DB_HOST', 'localhost');

    If that still does not work then make sure your MySQL server is up and running. Also, if you are getting lots of traffic on your website that MySQL server is unable to handle and throws this error.
    In this case the best thing you should do is contact your host and confirm the your MySQL server is running and capable of handling the traffic.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

  • Neil

    No, I have endless Wordpress problems, not doing well at all.

    I am just on with Bluehost, they have told me I am now using the wrong database prefix.

    > the database prefix is in the wp-config.php, you needs to set it to the correct one, you have about 5 of theme in your database

    they said wp-config was modified 5 hours ago, 'somehow'. certainly wasn't by me.

    I have no idea how to do what they say I need to do, I'm not a techie.

  • Neil

    Hi Sajid

    I'm having endless different Wordpress problems and I'm not a techie. I'm trying to follow the advice of one thread and it's impossible because of issues in another, so I'm just going in circles here.

    I will try and consolidate them all together and hopefully one person can take it in hand and fix them for me, please. I will send through my cpanel details for any one.

    1) Site completely down, due to modified wp-config file: https://premium.wpmudev.org/forums/topic/site-is-down-error-establishing-a-database-connection#post-1075370

    2) Memory issue, fixed for one site but not another: (http://vpevents.guru/)
    https://premium.wpmudev.org/forums/topic/site-keeps-going-down-error-500

    3) None of my sub-sites work: https://premium.wpmudev.org/forums/topic/cloud-migration-broke-multi-site-sub-sites

    This is driving me to nervous breakdown, please can someone help me.

    Neil.

  • Sajid

    Hi Neil,
    Hope you are doing good today :slight_smile:

    I know things are really odd here but trust me all these issues are fixable, only thing need here is patience.

    Any way, its not easy fix all these issue at once but lets start from first one. Send me cPanel login URL, username and password via our contact form and I will try to fix this issue. Also tell me what is the name of your WordPress database so I don't connect it with the wrong one.

    Don't post the credentials here in public forum. Send in using our secure contact form in following format.

    Subject: "Attn: Sajid Javed"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -cPanel login url
    -cPanel username
    -cPanel password
    -link back to this thread for reference
    -any other relevant urls
    Select "I have a different question" for your topic (see screenshot) - this and the subject line ensure that it gets assigned to me :simple_smile:

    Look forward towards your response :slight_smile:
    Cheers, Sajid

  • Sajid

    Hi Neil,
    Hope you are doing good today :slight_smile:

    Thanks for sending the cPanel login credentials. I created a new user and connected that user with cloudbes_wor9462 database to make sure the credentials are correct. But that did not made any difference. (I took backup of wp-config.ph file before making changes, you can find this file in same folder with wp-config-backup.php name)

    I then tried to make a static test connection with php code to make sure your server is running but it returned the user has already maximum connection opened error and abort connection.

    After that, it did not connect at all, it seems the server is refusing to make a connection with MySQL server.

    Then, lastly, I tried to install a test WordPress website on your server via WordPress installer of cPanel but it failed with 500 internal server error connection (see screenshot).

    Regarding the 500 internal server error, its timing out even on your bluhost cpanel as seen in attached screenshot below.

    So, by all means this is a server side issue instead of WordPress. Please contact your hosting provider for further assistance.

    Take care and have a nice day :slight_smile:
    Cheers, Sajid

  • Neil

    and now they've told me my restore options are last night or a week ago, so basically I can either restore a broken site or lose a week's worth of work. fucking great.
    I have sweat blood this week updating the site with the most important work I've done, it will be catastrophic to me if I lose it. please for the love of god can someone help me fix this mess, it's just a damn Wordpress site!!!

  • Nastia

    Hello Neil

    I'm sorry to hear you have these issues.

    Currently of your sites can't establish connection with the Database.

    You can try the following: Upload a fresh copy of a WordPress. Replace all the WordPress files in the PUBLICH_HTML folder except the wp-config.php and the wp-content folder.

    Another solution is to restore the database. You can do this by adding the following line in your wp-config.php file. Add it just before ‘That’s all, stop editing! Happy blogging’ line wp-config.php.

    define('WP_ALLOW_REPAIR', true);
    Once you have done that, you can see the settings by visiting this page: http://www.yoursite.com/wp-admin/maint/repair.php
    And follow the WordPress instructions.

    I tried to connect to phpMyAdmin but it requires another password. Would you please send to us the Database credentials so we could access it and check if the database is corrupted.

    Subject: "Attn: Nastia"
    - myPHPAdmin credentials
    -link back to this thread for reference
    -any other relevant urls
    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    We are waiting for your reply!

    Kind Regards,
    Nastia

  • Nastia

    Hello Neil

    With the replacing the WordPress core files, you will not loose your database. Just do not replace the wp-content files - uploaded files, plugins and themes are located there. And do not replace the wp-config.php.

    However, before repairing the database, it should not lose the data, but it we advise to create a backup of your database.

    If none of these steps will work, please try to contact again your host provider, describe all the steps that you have taken to resolve this issue which are:
    - Created a new DB user with all privileges
    - Database repair
    - Checked the database login settings in the config.php file
    - Replaced WP core file

    Before contacting your host, please try the last two options, which steps I have described in the above post
    Please mention as well what my colleague Sajid posted in the above post:

    The main point is you can't even install a new blank WordPress site using their own WordPress software installer.

    Let us know how it went!

    All the best,
    Nastia

  • Pontus

    Hi Neil,

    I am really sorry to hear about your troubles with your site. It sounds like you have some kind of hosting issues. If you would like, I can have a look into this. My approach would be for you to contact us on Skype, support@geborek.com, our business hours are 9-6 pm UTC+1. What we would do is to walk you through how to export your database from phpmyadmin, so you can download your database, where all your information is stored. You should also copy all the files from your wordpress install. What you need for this is your cPanel credentials, as well as your database credentials (login details). I do not want you to hand these out to us, I just want to walk you through how to export and download your data.

    After you have done this, I would like you to send me the database and wordpress install, and I'll have a look at getting it up and running on our servers, if it works immediately for me on my servers, then it's definitely bluehost who's at fault. If that's the case I would look at getting a new provider, and I'll give you a hand with how to import these with your new provider, or if you'd like, we can have a chat about us hosting your webshop in the future. If it does not work, we are fairly experienced repairing broken databases for both Wordpress and Magento, but there is a risk that it's more expensive repairing, than just redoing the work.

    A quick bit of information about us, we sell managed hosting of Wordpress and Magento focused on E-commerce, where we build and manage webshops for customers who are too busy to think about the IT-part of E-commerce. We are based in Sweden.

    I sincerely hope that you manage to sort this out with bluehost, but if you don't, please don't hesitate to give us a call, and we'll take a look, I'm sure this is fixable :slight_smile:.

  • Neil

    I have given up trying to get a resolution through this channel. I thought when I paid for tech support I wouldn't have to do it all myself too. There's no point me trying to learn how to do all this sys admin level stuff, I just need someone who can fix it, with immediate effect.

    If that gets someone hosting business then win/win, I don't care who I pay the hosting fees to or where it is hosted, or who gets the $99/mo tech support fees either, I just want a working Wordpress site and someone who fixes it when it breaks, end of. Neil.

  • Tyler Postle

    Hey Neil,

    I can imagine how frustrated you are here :slight_frown: I think we've all been in the situation where your site goes down and it's immediate panic time! Our support covers general WordPress issues and anything involving our own products; however, this turned out to be more of a complex system admin problem as Sajid mentioned above.

    We always try to help as much as we can - but in this case you will want someone more familiar with your type of hosting setup and specializing in system admin. Looks like Pontus would be a good candidate you could have a chat with them if you haven't already :slight_smile:

    Aside from that we also have a members only Jobs Board: https://premium.wpmudev.org/wordpress-development/

    You can find other system admins/developers within the community there. Another popular option I've been hearing lately is Codeable: https://codeable.io/ - you can check into hiring someone from there as well.

    I don't mean to push you away here, it's just the support you require is beyond our scope and those options above will be a lot better suited to get your hosting situation fixed up quickly :slight_smile:

    Cheers,
    Tyler

  • Pontus

    Hi again Neil,

    It looks pretty much like we would be an ideal candidate, since we are a full solution, from hosting to tech support for everything to do with your site. As Tyler from WPmudev said, their support capability cannot extend to your host, since they are plugin manufacturers mainly, and there are no issues with their products.

    If you could spare us half an hour of time today, I believe we can get your website up and running on our servers before tonight. Or if you email me your credentials, we can take care of copying your website to our servers without any need for you to be involved. However I thoroughly recommend against emailing anyone your private credentials, which is why I would like to walk you through this over skype, which will keep me from getting your credentials.

    I would also like to point out that we at Geborek Solutions are in no way affiliated with WPmudev, except that we use their plugins, and find these amazing to work with.

    Best regards
    Pontus

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.