Support » Fixing WordPress » Error establishing a database connection

  • Hi,

    My company previously had a WordPress site but the domain expired (it was hosted on Godaddy but we used WordPress CMS to run it). I have since renewed the domain but the wordpress site is still inaccessible. I need some help getting back into it but I’m being met with this error message :

    “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 you have typed the correct hostname?
    Are you sure the database server is running?”

    Can I have some help resolving these issues please as I need to get this site back up and running.

    I asked on wordpress.com but they couldn’t help as it’s not hosted there and they pointed me here. We had previously been running the site here using WordPress CMS :

    https://www.europeantourhospitality.com/wp-admin/profile.php

    Is it possible to look into whether that historically used to be the case as the team here are saying they used to log into WordPress to make changes to the site previously.

    Thanks,
    Seb

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Hi there.

    Sorry to hear you’re having this issue.

    First, have you seen this article explaining the possible causes of this error? https://wordpress.org/support/article/common-wordpress-errors/#error-establishing-database-connection

    Do you know if your hosting with GoDaddy also needed to be renewed, alongside the domain name? If so, it could be that the database details have changed. This is from the above article:

    “Error establishing a database connection” is usually caused by an error in your wp-config.php file. Access your site in your FTP client. Open up wp-config.php and ensure that the following are correct:

    Database name
    Database username
    Database password
    Database host

    If you can’t see any issues in your wp-config.php file, I’d recommend asking GoDaddy if they can help. For example, if they’ve needed to restore your hosting service, it’s worth asking if they have also restored your database to how it was previously set up. In any case, they should be able to help or point you in the right direction.

    Hope this helps, please let me know if you have any questions.

    Thread Starter smargolis

    (@smargolis)

    Thanks, yes our hosting with GoDaddy expired so I renewed it and got the database details reset to what they were previously. I don’t know what FTP Client we used so I’m unsure how to look into that, could you help with that?

    I’m going to get in touch with GoDaddy too but they insisted me they had reset it to its previous state.

    Any further help would be appreciated greatly.

    That sounds good if they’ve confirmed they’ve restored the database. There must be something slightly different from before for you to be getting this error though. I don’t think this is uncommon – they may have changed the database username and/or password for security reasons.

    It shouldn’t matter if you’re using a different FTP client this time around. There are several free clients available, such as FileZilla. There is an article here with a step-by-step guide on how to set it up.

    Once you’ve set up your FTP, you should be able to access your wp-config.php file and compare it to the details that GoDaddy have given you for the database access.

    Thread Starter smargolis

    (@smargolis)

    I am struggling to find a username and password account associated with this site and my company. Is there any chance you can check to see if there are any accounts for the domain @europeantour.com outside of this one?

    Thread Starter smargolis

    (@smargolis)

    or @europeantourhospitality.com

    I don’t have access to check for any accounts for you. To confirm, these are the forums for the free version of WordPress which you host yourself (as you are with GoDaddy), so there wouldn’t be an account I could check for you.

    However, I’m still super happy to help if I can. Which username and password specifically are you looking for? e.g. is it for your FTP login, or WordPress login?

    For your FTP login, these will be in an email that GoDaddy has sent you, and/or your GoDaddy account page. They have more information on their support page here: https://uk.godaddy.com/help/find-my-ftp-username-for-linux-hosting-16100

    For your WordPress login, once you get your database connected successfully, you’ll be able to reset your password from the login page. There are other ways to reset or retrieve them as well, but it’s more important to connect your database successfully before logging into your admin area.

    Thread Starter smargolis

    (@smargolis)

    I have access to my cPanel now, where would I look into database connections?

    Thanks for the help so far!

    You’re welcome!

    Brilliant, you should be able to access pretty much anything once you’re logged into cPanel. So for database info, from the cPanel home page, find the Databases section, click MySQL Databases. The MySQL Databases page shows your current databases and details for each one.

    Here’s some more information about managing databases in cPanel:
    https://uk.godaddy.com/help/view-database-details-for-my-linux-hosting-account-16021
    https://documentation.cpanel.net/display/82Docs/MySQL+Databases

    Thread Starter smargolis

    (@smargolis)

    Awesome and then what do I need to make sure is the same so they connect?

    Like where do I find what these need to be:

    Database name
    Database username
    Database password
    Database host

    (sorry I’m very new to this side of things)

    So when you’re using cPanel, the database host (or hostname) will always be localhost. I can see on your error page that it’s trying to connect to localhost, so you shouldn’t need to change this.

    For the other bits of info, you’ll need to find the database on the cPanel databases page. Is there a ‘Current Databases’ section on the databases page? As GoDaddy have said they restored your databases, you should have this section along with a table that contains at least one database with a list of users associated with it.

    Thread Starter smargolis

    (@smargolis)

    Ok I have found a database and a user associated with it! What do I need to do to make sure they’re correct?

    Awesome!

    Have you managed to download your wp-config.php file via FTP? It’s usually in the root (the top level directory) of your hosting. There’s more info about this file here: https://wordpress.org/support/article/editing-wp-config-php/

    You now need to match up the details listed in that file to the details in cPanel. The only thing that won’t be clear is if the password is correct, but you can reset that via cPanel too.

    There’s some info here about how to reset the database user’s password: https://documentation.cpanel.net/display/82Docs/MySQL+Databases

    There should be a ‘Current Users’ section, where they’ll be a ‘Change Password’ option if you don’t have the original password.

    Hello everyone.
    I’ve the same problem on Aruba and I use this thread to try to solve.
    I just (had to) change mySQL password on Aruba. But made this change, I was surprised. Now nothing works anymore.
    How should I solve?
    Thank you all.

    Hi @peppemuratore. Did you update the password listed in your wp-config.php file after you changed your database user’s password?

    Also, what type of error are you getting after updating the password? This will help narrow down the exact issue you’re seeing.

    Thread Starter smargolis

    (@smargolis)

    Hi @mikachan we managed to resolve the database connection issues, however now if you visit the site : http://www.europeantourhospitality.com it takes you to a default wordpress site as opposed to the site that we had built and were managing in wordpress before this all went down. Can you help me restore it to the previous site we had?

    Thanks!

Viewing 15 replies - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.