Forums

Error establishing a database connection (37 posts)

  1. pmperry
    Member
    Posted 6 years ago #

    Re: Installing WordPress on a Network Solutions (NS) hosted web site.

    After uploading my files to my Network Solutions hosted web site, I entered the obligatory
    http://www.adiatha.com/blog/wp-admin/install.php

    and got 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 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?"

    I solved the problem with the following procedure:

    Opened the NS Hosting Control Panel.
    Clicked on "database manager."
    Clicked on "mySQL database."

    Saw the numbers under "Server IP." There was an entry similar to this one:
    123.456.789.99

    Used that number to change the following line in the wp-config.php file:

    define('DB_HOST', '123.456.789.99'); // 99% chance you won't need to change this value

    Then uploaded that changed wp-config.php to my web site.
    Now when I aimed my browser at http://www.adiatha.com/blog/wp-admin/install.php
    and hit ENTER it all worked.

    P.S. Thanks to jeepfun for his former post that led me in this direction. Posted this step-by-step procedure for other newbies like me.

  2. WTF
    Member
    Posted 5 years ago #

    In my very recent experience there are three problems installing WordPress on a Network Solutions server:

    1. Setting up the database correctly
    2. Inputting the correct values in wp-config.php
    3. Doing the two above steps in the proper order

    The posts above by jeepfun and pmperry are correct: you DO need to change the 'localhost' setting to an IP number determined during your database setup. What is critical, however, is that you make sure you have set the database up correctly first.

    For specific instructions on setting up an NS database for WordPress, see this post:

    http://wordpress.org/support/topic/75607?replies=7#post-423032

    When you are sure you can access your database, follow the steps outlined above by pmperry for inputting the correct values into your wp-config.php file.

    [Moderator: given that Network Solutions is a fairly large hosting provider, and that more people will probably be trying to establish a WP blog on NS servers in the future, you may want to cut or change the comment in wp-config.php stating there is a 99% change the 'DB_Host' variable won't need to be changed. It was a red herring for me.]

  3. WTF
    Member
    Posted 5 years ago #

    The above post applies to a UNIX install on NS. I have no experience with a Windows install.

  4. maurj
    Member
    Posted 5 years ago #

    I'm on Mac OS 10.4.7, MySQL 5.0.24, and I found that updating my Mac OS X PHP install to 5.1.4 (from version 4.x) solved this problem for me.

    I used Marc Liyanage's excellent installer to do this:

    http://www.entropy.ch/software/macosx/php/

    Dave.

  5. dgrebb
    Member
    Posted 5 years ago #

    I also changed the the define('DB_HOST', 'xxx.xxx.xxx.xxx') and instantly got success.

  6. WPChina
    Member
    Posted 5 years ago #

    Is there any way to return ONLY a blank page when you et the "Error establishing a database connection" message? I don't want my users to see this db problem and instead just want to show a blank page... how can I do this?

    tks!

  7. xendrax
    Member
    Posted 5 years ago #

    I'm also getting the "Error establishing a database connection" during setup, but thanks to astrashe 's code i at least got a better error:

    Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\WORDPRESS\test\dbtest.php on line 7
    Could not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client

    I've only just downloaded the mySQL so it cant be that old ?!?! My ado version is 2.8.. PHP Version 4.4.2 (is this too old?)

    mysql
    MySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version 3.23.49

    I wondered if it was this client API version so i found somewhere on the mysql site that gave me an up to date php_mysql.dll [5.1.6.6] but i think this must have veen for php 5 because this was totally ignored even after i put it in the extensions folder and added it to the config file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.