Forums

[resolved] Error establishing database connection (5 posts)

  1. angharad256
    Member
    Posted 4 years ago #

    This is probably a really simple fix. I opened the wp-config-sample.php in notepad. This is what I changed:

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

    I did enter my actual password instead of 'my password,' and it's the same as it is in MySql database. When I go to http://www.cipher-wotr.com/news/wp-admin/install.php, I get this 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.

    Now, my server is pretty reliable and I can get into the rest of my website, http://www.cipher-wotr.com, with no problem. Am I entering the information correctly? Should I have put it elsewhere, or taken out punctuation? Thanks for your help.

    Angha

  2. moshu
    Member
    Posted 4 years ago #

    It should be:
    // ** MySQL settings ** //
    define('DB_NAME', 'cipherwo_news'); // The name of the database
    define('DB_USER', 'cipherwo_news'); // Your MySQL username
    define('DB_PASSWORD', '****'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

  3. skippy
    Member
    Posted 4 years ago #

    You renamed wp-config-sample.php to wp-config.php, right?

    Are you sure that localhost is the server on which your MySQL database is running?

    Does the user account you entered into wp-config.php actually exist in the MySQL database?

    The installation instructions might contain some steps you may have overlooked.

  4. angharad256
    Member
    Posted 4 years ago #

    Thanks, it was just that I had the positions switched for my db name, et cetera.

  5. vlherring
    Member
    Posted 3 years ago #

    I am having this problem too. I am using a Mac, OSX, host is netINS.net and to work with MySQL [which is up to par wiht what is needed for WP2] I go in thru the OS4 engine they have on their servers...I have named the DB name the one I gave it in the database creator [blog_herringlaw.com] and I have put in the username correctly which is shown and the password which I assigned and called it localhost but it's not allowing me to establish a connection...I did rename the sample as instructed...any other ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic