WordPress.org

Forums

Error establishing a database connection (18 posts)

  1. fcader
    Member
    Posted 10 years ago #

    I've edited and uploaded wo-config with everything else. I use 1and1 hosting and so in my MySQL settings I set the following line:
    define('DB_HOST', 'db69.perfora.net');

    When I went into wp-admin, I 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 db69.perfora.net

    The server *is* up and running, the password and username are correct, and I'm currently using MT on the same database.
    What have I done wrong?

  2. NuclearMoose
    Member
    Posted 10 years ago #

    Have you tried http://db69.perfora.net ?

  3. fcader
    Member
    Posted 10 years ago #

    I just did and that doesn't work either.

  4. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Tried 'localhost' ?

  5. fcader
    Member
    Posted 10 years ago #

    Yup, I had it at the default values initially. Once that didn't work, I fiddled around with db69.perfora.net.

  6. Mark (podz)
    Support Maven
    Posted 10 years ago #

    If we assume that the db69 connection is actually correct, then have you carefully stared at the other information ?
    No spaces ?
    No capitalisation problems ?

  7. fcader
    Member
    Posted 10 years ago #

    My password, username, and database name are correct for sure.
    db69.perfora.net is what is listed in my CP under "Host Name," so I'm assuming that's correct too.
    MySQL is not a strength of mine, but I do think I've got all this right.

  8. fcader
    Member
    Posted 10 years ago #

    Perhaps the fact that I am only allowed 1 database has something to do with it? It's currently being used by MovableType.

  9. Mark (podz)
    Support Maven
    Posted 10 years ago #

    It's no strength of mine either, I've just helped a few people through this :)

    Does your cpanel show any sort of 'Connection String' ?
    Have you created a new database ?

  10. fcader
    Member
    Posted 10 years ago #

    No, because I "have already used the available number of databases," though I do have 98MB of space left.
    On the other hand, I am feeling destructive. I wouldn't mind, too much, just deleting the present database and creating a new one.

  11. NuclearMoose
    Member
    Posted 10 years ago #

    You don't need a new database. You can use the same database, as WordPress will just add the required tables.

  12. fcader
    Member
    Posted 10 years ago #

    Fixed!
    I don't know why, but this is how:
    1. I went into my CP and changed my database password.
    2. Deleted wp-config.php.
    3. Went to wp-admin/install.php, which ran the manual set up.
    Voila!
    Thanks everyone (:

  13. fcader
    Member
    Posted 10 years ago #

    On comparing the old and the new files, I discovered the problem.
    Aiyy caramba, I knew it'd be something stupid.
    What I'd done was:
    define('databasename', 'wordpress');
    instead of:
    define('DB_NAME', 'databasename');

    I know no PHP. But perhaps for other PHP novices, you might want to put in a word of advice?

  14. troublemaker
    Member
    Posted 10 years ago #

    i have that error but that didn't work

  15. futuhat
    Member
    Posted 10 years ago #

    i had the same problem ['error establishing a database connection'] and i've changed 'DB_HOST', 'localhost' for 'DB_HOST', '127.0.0.1' and... the problem seems to be fixed!

    ... so this is the 1% chance i need to change this value! ;¬)

  16. bpuppy
    Member
    Posted 10 years ago #

    I tried both of those things and still nothing for me. Could it be because I'm running 10.4 tiger?

    The config file is right, as is the username (root) and password (I used the password to login to MySQL in terminal so I know it's right)

    Tried changing DB_HOST to 'localhost' and 'computername.local' and '127.0.0.1' and still same error.

    How do you change the MySQL password?

    Any ideas?

  17. cameroon
    Member
    Posted 10 years ago #

    Hi bpuppy, did you install the MySQL 4.1 distribution from MySQL.com? If so, the problem is that the version of PHP distributed with Mac OS 10.4 doesn't use the mysqli library, which means that you can't authenticate against a MySQL version 4.1 installation.

    You can either go about upgrading PHP, or downgrading MySQL to version 4.0. Personally I went with 4.0 because it was a whole lot easier.

    If you didn't install MySQL 4.1, then I'm not sure where to point you. That was the problem I had though.

  18. kb
    Member
    Posted 10 years ago #

    Hi Guys

    wordpress has been working fine for weeks since installation. Now I get:-Error establishing a database connection at both domains where it is loaded. I haven't changed anything - and posted 2 articles on one domain earlier today. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.