Forums

How to fix: Error establishing a database connection (2 posts)

  1. cjuices
    Member
    Posted 10 months ago #

    When I originally set up my client's site, I created a folder in my main domain. My host is GoDaddy and I have a Deluxe plan which allows me to create sub-domains.

    http://mydomain/clientname.com

    My client did not want my domain on the url.

    The entire site had been set up and functioning with theme and database. We were using it for months and there were many pages etc.

    I mistakenly went into the Admin/Settings and deleted “mydomain” from the WordPress address and Site address.

    Of course as soon as I saved that I got the “Error establishing a database connection”
    I have a backup of all my wp-content folders as well as database backups from a db backup plugin.

    So in GoDaddy I uninstalled WP and, when asked, saved the original database with the broken urls.

    Then I set up a subdomain with the client’s site and reinstalled WP, again using GoDaddy. It worked fine, but did not have my database. So in GoDaddy’s MySQL I “restored” the new database with the broken one.

    I again got the “error establishing a database connection”. After research I went into the database and changed the urls to the correct one. Then I went into my wp-config.php and fixed the MySQL settings with the ones from the new restored database.

    I still get the error establishing database. When trying to log into wp-admin I get the message:

    “incorrect or we can't contact the database server at pin1003106265086.db.5119239.hostedresource.com”.

    This is an old, non existent database. Am I missing something? How can I fix this?

  2. t-p
    Member
    Posted 10 months ago #

    -First, try contacting the hosting provider if the database server is online / if they have any other problem at their end, or they made any changes to your account, or if there are any limitations/restrictions, etc .

    - double check your wp-config.php file settings for the database name, database username and database password. This is where most errors occur.

    -Then check that you don't need to change the database host from "localhost" to something else. You can get that info from your hosting provider.

    -Check you have actually created a database with the same database name as is in your wp-config.php file. -Last, but not least, if all that information is correct your database probably has a problem with it, and you may need to contact your hosting provider.
    There are also many threads on this topic on these forums:

    http://wordpress.org/search/Error+establishing+a+database+connection?forums=1

Reply

You must log in to post.

About this Topic