WordPress.org

Support

Support » Installation » WordPress and 1and1 – Localhost for the DB?

WordPress and 1and1 – Localhost for the DB?

  • seraphim
    Member

    @seraphim

    Hello all,

    Trying to install WP on 1and1. I get the following error message.

    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. This could mean your host’s database server is down.

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

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    Do I set the DB_HOST to localhost for 1and1? Searched through the forum but couldn’t find an answer.

Viewing 15 replies - 1 through 15 (of 18 total)
  • jennmiller
    Member

    @jennmiller

    1and1 does not use “localhost”. You’ll have to use the hostname they gave you 😉

    seraphim
    Member

    @seraphim

    Thanks. Figured it out and it now works beautifully 🙂

    Hi Seraphim,
    I am with 1and1 and in the MySQL Configuration control panel
    it mentions host name: localhost.

    Am I not looking in the right place? Where in 1and1 did you find host name?

    TIA

    Cainan

    I’ve stared at username, password, and hostname for hours now and entered them in multiple times in as many configurations and am getting the same error message. Any ideas as to what might be happening?
    1and1 say my database is running fine…so it must be me, right?

    Mark (podz)
    Support Maven

    @podz

    Replace your password with XXXX’s and paste the wp-config.php here. We can take a look too 🙂

    Ok…I had to sleep for a while. I’ve finally been able to install WP but when I open my URL (www.markearley.org)I don’t see WP anywhere.
    I’m extremely new to all of this. I’ve put a few objects into my website via Dreamweaver and wasn’t sure how this would work by putting WP into my root directory on my server (1and1). Should I have put it into another directory? I don’t think I have another directory. I’m ready to scrap the whole thing and start over.

    Harmonikan, when you log into your 1&1 control panel, navigate to “Websites and Applications”, then “MySQL Administration”. Then you you should find all your information for Database Name, User Name, Password, and Host Name.

    As you will see, 1&1 do not use localhost, but rather “dbXXX.oneandone.co.uk”.

    Sounds to me like you should do a fresh install of WordPress. The root directory of your URL is absolutely fine to put it in.

    If you need any more help, let me know, because I’ve installed about about five different WordPress sites all using 1&1 hosting so find it fairly straightforward now.

    Kind regards
    Croila

    Thanks for the information Croila…I’ll try again soon. Must write a paper now.

    Hi all,

    I have experienced the same problem with 1and1. Here’s my wp-config.php. I checked my username etc. It still does not work ! Any help would be appreciated. Thanks !

    Jsaulg

    oops… forgot this

    <?php
    // ** MySQL settings ** //
    define(‘db151107765’, ‘wordpress’); // The name of the database
    define(‘dbo151107765’, ‘username’); // Your MySQL username
    define(‘XXXXXX’, ‘password’); // …and password
    define(‘db266.perfora.net’, ‘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’);
    ?>

    I installed on my 1and1 server, and it works fine. Your problem is that you didn’t remove the example values. It needs to look like this:

    <?php
    // ** MySQL settings ** //
    define(‘db151107765’); // The name of the database
    define(‘dbo151107765’); // Your MySQL username
    define(‘XXXXXX’); // …and password
    define(‘db266.perfora.net’); // 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’);
    ?>

    You had multiple values returned, you need to just list the real ones.

    Thanks Jonowinn. I followed your advice and still the same error message:

    ***
    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 checked the database server and the status is Ready. I changed the password in my settings, and still nothing…

    Very frustrating !

    This is the correct format

    define('DB_NAME', 'db151107765'); // The name of the database
    define('DB_USER', 'dbo151107765'); // Your MySQL username
    define('DB_PASSWORD', 'XXXXXX'); // ...and password

    Eureka !! That worked ! Thanks archshrk !

    Was thinking about using WordPress and 1and1, and I found this thread. Just wondering how well the 1and1 setup in general conforms to the WordPress requirements. Any feedback would be great.

    Thanks!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘WordPress and 1and1 – Localhost for the DB?’ is closed to new replies.