• Here’s my error:

    “Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost.”

    my host: 1and1.com
    the directory that the wordpress files were uploaded to: https://www.complainingface.com/blog/

    my host gave me this:
    Database name db124737218
    Host name db173.perfora.net
    Port 3306 (standard port)
    User name dbo124737218
    Password ***********
    Status setup started

    here’s what I’ve got in my wp-config.php file:
    define(‘db124737218’, ‘wordpress’);
    define(‘dbo124737218’, ‘username’);
    define(‘*********’, ‘password’);
    define(‘db173.perfora.net’, ‘localhost’);

    Any help would be appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'db124737218'); // The name of the database
    define('DB_USER', 'dbo124737218'); // Your MySQL username
    define('DB_PASSWORD', '********'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    That should should be it.

    As that part of the file says 99% of the time the local host shouldn’t be changed.

    EDIT You should be able to copy and paste the above code into your config file, with the addition of your password.

    Thread Starter adam045

    (@adam045)

    I still get the same error.

    The troubleshooting message suggests that the database server may not be running. Is there any way to verify this?

    Thread Starter adam045

    (@adam045)

    I figured it out.

    define(‘DB_HOST’, ‘localhost’);

    was supposed to be
    define(‘DB_HOST’, ‘db173.perfora.net’);

    I must be that 1% d’oh!

    Change localhost to db173.perfora.net and live the rest as it was suggested above!

    Ah, you must use 1and1, huh? Yep, I had to make the same change, but it’s no biggie. Good thing you figured out which field to edit! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘What value to enter for localhost in wp-config.php?’ is closed to new replies.