Forums

Error Establishing Database Connection (8 posts)

  1. bmoody1962
    Member
    Posted 3 years ago #

    I'm unable to access anything in my sidebar related to my blog. I'm logged in with the correct username and password. It won't let me log out to log in again without receiving the error message below. I'm a newbie and don't really understand what else I can do to correct the error. Please help; thanks. The error message that I receive is:

    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.

  2. bmoody1962
    Member
    Posted 3 years ago #

    Hmmm. It seems to work now. What's up with that?

  3. 35mhz
    Member
    Posted 3 years ago #

    I get Error establishing a database connection

    I have in the wp-config file the following values

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'db.timcalvert.f2s.com:3306'); // The name of the database
    define('DB_USER', 'timcalvert'); // Your MySQL username
    define('DB_PASSWORD', '*****'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    The ISP gives me the following instructions

    The PHP syntax for connecting to your freedom2surf database server is:

    mysql_connect("servername:port", "username", "password")

    Do you think this is correct

  4. whooami
    Member
    Posted 3 years ago #

    take that 3306 out of the wp-config.php -- Thats the standard port for mysql; wordpress knows what port to connect to.

    Also, that entire line is hosed -- Youre not reading.

    It says:

    define('DB_NAME', 'wordpress'); // The name of the database

    thats not the name of your database, that the connection stuff your host gave you. (least thats what it looks like to me, since youve tacked on a port # to it, especially)

  5. Chris_K
    Administrator
    Posted 3 years ago #

    and then replace localhost with servername from that connect string your host gave you.

  6. 35mhz
    Member
    Posted 3 years ago #

    Changed to this

    Now get this

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress database.

    Using this config
    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'wordpress'); // The name of the database
    define('DB_USER', 'timcalvert'); // Your MySQL username
    define('DB_PASSWORD', '****'); // ...and password
    define('DB_HOST', 'db.timcalvert.f2s'); // 99% chance you won't need to change this value

  7. 35mhz
    Member
    Posted 3 years ago #

    Ah sorted

    DB has name of timcalvert not wordpress

  8. Chris_K
    Administrator
    Posted 3 years ago #

    Excellent!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.