WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error establishing a database connection (5 posts)

  1. Nitruc Co
    Member
    Posted 5 years ago #

    Seems like this problem happens to a lot of people but I couldn't find a step by step fix in any of their posts...

    Right now I have 2 websites that use 2 different databases which I host on 1 server. Last night everything was going fine until I tried changing my 2nd website by switching the folder that it was being hosted in and then changing the blog name and address under the WordPress settings.

    After that both my websites stopped working. I'm pretty sure I didn't change anything on my main site that would cause it to break, I just changed the info and folder of my secondary site...

    Now I can't access either sites or the admins. I only get the "Error establishing a database connection" text when my page finishes loading.

  2. Nitruc Co
    Member
    Posted 5 years ago #

    Oh yeah and I tried deleting/replacing files with no luck...

  3. dieselpower44
    Member
    Posted 5 years ago #

    have you opened the wp-config.php file and checked that you have the hostname correct? for some reason, web hosts such as GoDaddy don't like 'localhost' and instead require the entire hostname such as 'xjsh4664fdvsb63.securehostingserver.com'
    basically I had this problem yesterday and you just need to make sure that the settings (user, pass, hostname etc.) match the settings in your hosting account's database settings. I wish there was a step by step guide I could point you to but unfortunately I couldn't find anything concrete either!

  4. Nitruc Co
    Member
    Posted 5 years ago #

    Yeah, for some strange reason when I changed the the blog name/url of my second blog which is in its own folder and not even in the root, it somehow messed everything up...

    I even tried replacing the wp-config with no luck. Tried replacing the wp-config again and second time was a charm.

  5. dieselpower44
    Member
    Posted 5 years ago #

    glad you fixed it ;)

Topic Closed

This topic has been closed to new replies.

About this Topic