WordPress.org

Ready to get started?Download WordPress

Forums

wp-config and Error establishing a database connection (8 posts)

  1. AlaskaGraves
    Member
    Posted 1 year ago #

    I am trying to change the contents of a site for a client of mine. They let me onto their GoDaddy account, but they don't know the password to their wordpress account. So I changed the password to their MySql for them, and then I changed it in wp-config, and now I'm getting "Error establishing a database connection" when I try to login.

    I did not change anything else in wp-config. Is there something I'm missing? should there be another file I need to change as well?

    I realize if I were smarter I would have backed everything up before hand and just changed the wordpress admins password in MySql, but I didn't think of that.

    Any suggestions?

  2. catacaustic
    Member
    Posted 1 year ago #

    I'm a little confused here.

    Did you update the password for the admin account in the database, or did you change the MySQL users password on the server?

    If you changd the admin users password in the DB, then you do not need to change the wp-config.php file. The admin password should not be the same as the MySQL password in that file. Change it back to the original and it will work again.

  3. AlaskaGraves
    Member
    Posted 1 year ago #

    No, I changed the password to access the MySql database.

  4. catacaustic
    Member
    Posted 1 year ago #

    OK, then you have either tyed it wrong when you changed it, or when you put it into your wp-config.php file. I'd suggest changing it again, but do it by tying the new password in notepad or something similar (not Word...) and using a copy-and-paste to enter it into the MySQL system as well as your wp-config.php file to ensure that they are both the same. if that doesn't work, get in contact with your hosting company and ask them if they can sort out what is wrong because they are the ones that wil be able to look further then this.

  5. AlaskaGraves
    Member
    Posted 1 year ago #

    I tried that, I know I typed it in correctly, so I copied and pasted as well.

    Right now I am restoring the MySql database to 5 hours ago, before I messed with it, but it is taking a long time. I'm hoping that will change it back to the old password.

    I noticed that the old password didn't have a special character (!@<) but when I made the new one I had to have one. Do you think the trouble is with that, maybe?

  6. catacaustic
    Member
    Posted 1 year ago #

    If the error that you're getting is "Error establishing a database connection" then you have the DB connection details wrong in your wp-config.php file, there is no question about it. Sorry to be blunt, but that's the only cause of that error message.

    Restoring the DB won't do anything because that doesn't have any effect on the mySQL users password - that's not stored in your WP database. It will just loose any data that's been added in the last 5 hours.

    The special characters that will make a difference in a password are $, \, ' and " as these can cause issues. if the special characters aren't any of these then they should not be a problem.

  7. AlaskaGraves
    Member
    Posted 1 year ago #

    Yes, I realize that. I was just hoping it would restore the old password since it had no special characters, and no, I didn't use of of those.

  8. catacaustic
    Member
    Posted 1 year ago #

    I'd suggest resetting the password again. If that doesn't work, double-check the other settings in the file. If you do all that and it doesn't help contact your hosting company so they can help you out with the correct details, or to find out why these ones aren't working like they should be.

Topic Closed

This topic has been closed to new replies.

About this Topic