Forums

Error with install, ref DB_HOST (5 posts)

  1. londerwost
    Member
    Posted 5 years ago #

    When using /wp-admin/install.php I get the following 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 DB_HOST. This could mean your host's database server is down."

    I have tested the DB and it works, I can log into it just fine. I made the exact changes that were instructed in the installation guide. Is there something wrong with the code? Am I missing a step?

    This is the code that I have with *** for the username, DB name, password, and IP address (not posting that on a public forum):

    <?php
    // ** MySQL settings ** //
    define('***', 'wordpress'); // The name of the database
    define('***', 'username'); // Your MySQL username
    define('***', 'password'); // ...and password
    define('localhost', '***'); // 99% chance you won't need to change this value

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-includes/languages.
    // For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

  2. Michael Bishop
    Forum Concierge
    Posted 5 years ago #

    You need to swap the *** with the wordpress, username, and password.

    So instead of define('***','wordpress')

    you need define('DB NAME','***'), etc

  3. londerwost
    Member
    Posted 5 years ago #

    Sorry I was not clear. I know this. I'm not going to post it on the forums. FOR THIS POST I put the *** over the username, etc...

  4. Les Bessant
    Moderator
    Posted 5 years ago #

    Which is why it didn't work, it should look like this:

    define('DB_NAME', 'your_database_name');
    define('DB_USER', 'your_user_name');
    define('DB_PASSWORD', 'your_password');
    define('DB_HOST', 'your_database_server');

    And while it does say there's a 99% chance you won't need to change the server name from "localhost", this does depend on your host.

  5. londerwost
    Member
    Posted 5 years ago #

    Now I feel silly. Thanks for the clarification!

Topic Closed

This topic has been closed to new replies.

About this Topic