• Hello everyone…I’m hoping someone out there can help. I’ve tried over and over to get this to work, but end with this same result. I have added the error message below. I’ve verified the database name, username, and password, but it still errors. Is there something else I’m missing? I’ve tried for three days. I really appreciate any help you can provide. Tazz

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at localhost could not be established. This could mean your host’s database server is down.

    • Are you sure you have the correct username and password?
    • Are you sure you have typed the correct hostname?
    • Are you sure the database server is running?

    If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Imagethreadi

    (@threadi)

    I would recommend contacting your host’s support team to clarify whether the database access data is correct.

    To give yourself a little sanity check and make sure that you do indeed have the right hostname information, username, and password, you could connect manually to the database.

    It wouldn’t hurt to run a command line manual connection, like this…

    mysql -u database_username -p -h database_hostname database_name

    If you run that command using the same info that is in your wp-config.php, you should be able to see what the exact problem is from looking at the output of that command.

    ImageJorge Luiz

    (@jluizsouzadev)

    • Did you already try to recover your site from some previous backup?
    • What did trigger that issue? Some update or other thing else? If so, describe to us in more detail about one in this thread.
    • Is your hosting plan shared ou a dedicated server?
    • Do you have FTP access?

    • This reply was modified 2 months ago by ImageJorge Luiz. Reason: formated my text

    May I suggest you try an edit to your wp-config.php file that has resolved the issue for other users when localhost isn’t resolving properly? Changing localhost to the loopback address at 127.0.0.1 can resolve the unable to connect to database issue in that instance. If you have write access to the files in your WordPress installation, you can try to change localhost to 127.0.0.1 as shown below and try your connection again.

    /** Database hostname */
    define( 'DB_HOST', '127.0.0.1:3306' );
Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.