Error establishing a database connection (37 posts)

  1. obscure
    Posted 8 years ago #

    If it was working fine a month ago then either you changed something recently or your host did or you WP install somehow became corrupted. Did you change anything?

  2. allyanders
    Posted 8 years ago #

    I'm having the same problem as Clew. For the past 7 months my wordpress has run flawlessly. Occasionally it slows down if someone else on the server is hogging it but this morning I started getting "database connection error" at least 10 times an hour. If you refresh the page once, sometimes twice, everything comes back up and keeps on going. I get both the back end (admin) error and the front ender user error.

    I have changed nothing in my config. I upgraded to 2.3.2 last month. Everything was going great.

    Any clues as to what to tell my stupid hosting company so they can help me fix the problem? They simply see that the database is running. It's running, but not consistantly. I've been tracking each error since 1o'clock.

    I'm a designer, not a coder. But my users are experiencing these errors today and I'm starting to get irritated about it.

  3. clussman9
    Posted 8 years ago #

    clew, your hosting company probably moved the database causing 'localhost' to fail. Ask them for the IP address of the DB server and see if that solves the problem.

    allyanders, you might try asking your hosting company to look into it for you, particularly if you're experiencing intermittent errors. On shared hosting it could be that someone else is running code that is locking/crashing the database. Or it could be something else entirely. Your hosting company is in the best position to figure that out.

  4. kmessinger
    Forum Moderator
    Posted 8 years ago #

    For me, if I was experiencing a db error I would not ask my host if the db was working until after I did my homework.

    Log into your website or domain admin. Go to HostManager or the like or look around until you find something that says database. Go there and you should find a database admin which is often myphpAdmin but whatever it is you should be able to log in. The name and password you use to login with is what goes into the wp-config file.

    After you have logged in your db admin should say somewhere the version of mySQL and "running on XXXXXXX" That most of the time (maybe not 99%) will say local host but whatever it says is what you put into your wp-config.

    While you are there look around. Open some screens and become a little more familiar with the "heart" of WordPress. Just DON'T change anything. When finished log out.

    If you cannot log into your database neither can WordPress. As clussman9 said shared db can cause problems but AFAIK nomally only a slowdown. If someone is crashing the db the host won't put up with that for long.

    If you are tracking errors great! When the db goes down, call the hosting company and tell them it is down right now. Send them screen shots. That will help them and they will fix it or move you to a better database (I know from experience).

    Finally (yes, there is an ending) if all has been running ok and then suddenly changes and you have done nothing then it is the hosts problem not WP. Something has changed on the server. When you log into your website admin you should be able to find server information somewhere. Print that out. If suddenly you have a problem go to server information and compare.

    People won't do it for you. You have to be a sleuth to open the doors so your host will look in.

  5. jordybee
    Posted 8 years ago #

    Dbenson's post saved me! I just ran into the same problem and it turns out I needed to change the host name and password in my wp-config to match my sql database.

    Thank you so much! My former server crashed and I decided to switch to GoDaddy. I only lost about 2 weeks worth of content from my blog, but I was so worried I wouldn't be able to upload my backup.

    I have a Linux PHP account hosted by GoDaddy. I was getting the same errors until I changed "localhost" to the hostname listed in my SQL database control panel on GoDaddy. Everything immediately started working perfectly. The entire process took about 15 minutes. Uploading the files was about 5 minutes of that. Hope this helps.

  6. 2clicks
    Posted 8 years ago #

    I had these problme, and I solved writting the URL NUMBER and not LOCALHOST. Maybe you can find this intranet url in your Host Panel Center >> SQL Databases.

    Hope it helps!

  7. Kristea
    Posted 7 years ago #

    Thanks for all the feed on this problem of wrong password on my wp-config.php. that I am experiencing now with the error message of ' no connection between WP and my 000webhost.com'

    Can anyone tell me how to correct this when I cannot save my corrections on the wp-config.php file and I obtained a message "file cannot be saved now"?

    Also i observe that my server on my admin panel is different from the server number stated on my wp-config.php Is the error of blocked connection between WP and my webhost due to different servers?

Topic Closed

This topic has been closed to new replies.

About this Topic