What to do???Wordpress: "Error Establishing Database Connection" when typing my URL

15 replies
Hey all.

My site is down. Wordpress just announced a new Version update. Wordpress 3.2 or something. Before updating, they recommended backing up files & databases.

Well, I didn't know exactly what I was doing and obviously made a mistake. Now I am getting an "error establishing database connection" message when typing my URL.

I tried reading up what to do and check the wp-config.php file like recommended with no hope.

I have contacted my hosting provider. I hope they respond quickly. I hope they can help. They are in the Britain or something. I don't know what else to.

NOTE: I have a self hosted Wordpress website that was installed through my Hosting control panel.

Anyone had this problem before? Anyone have any suggestions?

Thank you.
#dowordpress #typing #url
  • Profile picture of the author Istvan Horvath
    Before updating, they recommended backing up files & databases.

    Well, I didn't know exactly what I was doing and obviously made a mistake. Now I am getting an "error establishing database connection" message when typing my URL.
    That's not enough information to go with... but I'll try.

    1. I bet you were using the "automated upgrade". It always can go wrong, unofrtunately.

    2. So, what exactly did you do when attempting to backup?
    Did you use a plugin? Did you do it manually via phpMyadmin?

    3. That error always says this: the WP script can not make a connection with your WP database because:
    a) wrong info in the wp-config file
    b) your host's database server is down
    c) there is no database

    Yes, zillion people have the same error message when they screw up their blog.

    So, in order to get more specific help, try to describe exactly the steps you did and the results you have seen.
    Signature

    {{ DiscussionBoard.errors[2946977].message }}
  • Profile picture of the author techvic
    Do you have your original wp-config.php file? Maybe as a local copy? That will have your old db info hopefully.
    Also you should be able to login to your hosting cpanel, Plesk or whatever it is and go to databases. You ought to see your blog db there. See if it's a "localhost" or if there is a more specific address associated with the database.

    The wp-config.php defaults to "localhost" as the hostname. My guess is it's something other than localhost and that was in your old wp-config.php file.
    Good luck.
    {{ DiscussionBoard.errors[2947030].message }}
  • Profile picture of the author indexphp
    make sure wp-config.php is in your root folder and the db username and password is correct.

    if it's wp-config-sample.php, rename it to wp-config.php and re-enter your db username and password.
    {{ DiscussionBoard.errors[2947071].message }}
  • Profile picture of the author Tim Franklin
    Hi, some friendly advice, have a look at where you are at using FTP, sometimes it can be something simple so dont jump off the cliff straight away.

    start with wp-config.php but look at the code first, before you rename anything,
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[2947089].message }}
    • Profile picture of the author aliyah7
      Hello everyone and thanks for your help. I will try and explain what happened. I never did update Wordpress because my site went down sometime in the process of saving my database.

      Here's what I did.

      I wanted to save my Wp database. Like Wp recommended.
      So, I went to my control panel.
      I found MySQL Databases file.
      I opened it up and it said that I could create & manage databases.
      So I created a new database with a username and password.
      Then it sent me to an area called PHPMyAdmin (I could not get to this area without first creating a MySQL database first).
      In a menu drop down bar it had the database name I had just created. I chose it.
      When I chose the newly created database, it said it the tables were empty.

      I saw another file name in the drop down menu and I chose it and opened it.
      It had all my database files in it. So, I went through the steps to save the database.
      It saved my Wp-Database.
      When I went back to my site. The Database connection error showed up.

      I found my Wp-config.php file in my control panel, but don't know what needs to be changed, if anything.
      {{ DiscussionBoard.errors[2947394].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by aliyah7 View Post

        Here's what I did.

        I wanted to save my Wp database. Like Wp recommended.
        So, I went to my control panel.
        I found MySQL Databases file.
        I opened it up and it said that I could create & manage databases.
        So I created a new database with a username and password.
        Then it sent me to an area called PHPMyAdmin (I could not get to this area without first creating a MySQL database first).
        All wrong and useless. Sorry.

        From the same place in your cPanel where you entered the new database creation panel you can select the phpMyadmin link. THAT's what you want to do - next time.
        When in phpmyadmin, you follow these steps:
        - on the left you select the WP database
        - when opened, on the top > select Export
        - save it as a file (.sql) - there is a checkbox for it
        That's it.


        Originally Posted by aliyah7 View Post

        In a menu drop down bar it had the database name I had just created. I chose it.
        When I chose the newly created database, it said it the tables were empty.

        I saw another file name in the drop down menu and I chose it and opened it.
        It had all my database files in it. So, I went through the steps to save the database.
        It saved my Wp-Database.
        When "saving it" did you follow the steps I outlined above?

        Originally Posted by aliyah7 View Post

        When I went back to my site. The Database connection error showed up.
        You must have done something else to cause this. Just creating another empty database would not end up with the wrong connection.

        Are you sure you actually saved/exported/backed up you database?
        It looks as if you deleted it

        Originally Posted by aliyah7 View Post

        I found my Wp-config.php file in my control panel, but don't know what needs to be changed, if anything.
        If you still have the original DB - nothing should be changed.
        Signature

        {{ DiscussionBoard.errors[2947457].message }}
  • Profile picture of the author Tim Franklin
    @ aliyah7

    Please hold up you are about to do serious damage to your website, (if it is not already too late) Just getting the SQL file will not restore your wordpress website, I know a lot of people think this but it does not work like that.

    you need to examine and find (hopefully) the original files, and then (connect) up the old database with the old file system, unless you deleted it,(

    The reason I know this is because someone once told me to do this, (you know got to PHPmyAdmin and get the SQL files then run a query and Baaam, nothing worked, I was totally Skrewed.

    The person that gave me that advice meant well but they just did not understand how wordpress works, anyway let us know how it turns out and let me know if I can help, but please dont do anything until you can see where the problem is and how to fix it,
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[2947489].message }}
    • Profile picture of the author aliyah7
      Originally Posted by Tim Franklin View Post


      you need to examine and find (hopefully) the original files, and then (connect) up the old database with the old file system, unless you deleted it,(
      I saved both the files and database. I just don't know how to connect the old database with the original old file.

      NOTE: After first receiving the "error database connection" message, I panicked and tried to go back and restore the database I had just saved. In the process I chose to erase the files and upload the database zip file I had just saved. I totally misunderstood, but doing this, I accidentally erased all my wp files from my control panel when trying to restore my database files. What in the world was I thinking??? When typing in my URL, the message then said : There is no server found for this URL. Or something like that. Then I panicked even more. I found the saved wp file and uploaded it back to my Control panel area. Now the message is back to "Error establishing database connection".

      Now I wait for my hosting provider; someone from ebay. They are from Britain or something. I don't know what to do at this point.

      I wish I would have taken my time when doing all this. Being too anxious and panicking only made things worse.
      {{ DiscussionBoard.errors[2947623].message }}
      • Profile picture of the author Tim Franklin
        There is a chance that you may still be able to recover,
        I would copy your wordpress directory, before doing anything else, it is possible that the files are still there, it does sound like you may have done it in, but just in case I would copy them first,

        I see your getting some help, let us know how it turns out, crossing fingers for you.

        Originally Posted by aliyah7 View Post

        I saved both the files and database. I just don't know how to connect the old database with the original old file.

        NOTE: After first receiving the "error database connection" message, I panicked and tried to go back and restore the database I had just saved. In the process I chose to erase the files and upload the database zip file I had just saved. I totally misunderstood, but doing this, I accidentally erased all my wp files from my control panel when trying to restore my database files. What in the world was I thinking??? When typing in my URL, the message then said : There is no server found for this URL. Or something like that. Then I panicked even more. I found the saved wp file and uploaded it back to my Control panel area. Now the message is back to "Error establishing database connection".

        Now I wait for my hosting provider; someone from ebay. They are from Britain or something. I don't know what to do at this point.

        I wish I would have taken my time when doing all this. Being too anxious and panicking only made things worse.
        Signature
        Bitcoin | Crypto | Blockchain Secrets |
        {{ DiscussionBoard.errors[2947955].message }}
        • Profile picture of the author Istvan Horvath
          Originally Posted by aliyah7 View Post

          Email sent. thanks.
          That's not enough!

          Originally Posted by Tim Franklin View Post

          I see your getting some help,
          Kinda. I may be naive... however I think when getting help one should sit there, staring at the email Inbox in case the volunteer helper needs some more info, data, right info, etc.

          Unless the house is burning you should be waiting for my reply, not the other way around.

          Oh, well...
          Signature

          {{ DiscussionBoard.errors[2947980].message }}
  • Profile picture of the author Istvan Horvath
    @aliyah7,

    if you get stuck, contact me at support at "myname" dot com and give me login access. If you didn't delete the database I might be able to help you...
    Signature

    {{ DiscussionBoard.errors[2947531].message }}
    • Profile picture of the author aliyah7
      Originally Posted by Istvan Horvath View Post

      @aliyah7,

      if you get stuck, contact me at support at "myname" dot com and give me login access. If you didn't delete the database I might be able to help you...
      Yes, will do right now. Thank you so much.
      {{ DiscussionBoard.errors[2947642].message }}
    • Profile picture of the author aliyah7
      Originally Posted by Istvan Horvath View Post

      @aliyah7,

      if you get stuck, contact me at support at "myname" dot com and give me login access. If you didn't delete the database I might be able to help you...
      Email sent. thanks.
      {{ DiscussionBoard.errors[2947727].message }}
  • Profile picture of the author Tim Franklin
    It sounds like he needs a helping hand, )
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[2947546].message }}
  • Profile picture of the author Istvan Horvath
    Update.

    It seems the OP deleted the original database at some point of messing around with phpmyadmin.

    Unless the host makes regular backups of the DB - there is nothing we can do about it.
    Signature

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

Trending Topics