WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection (11 posts)

  1. chlopczyk
    Member
    Posted 9 years ago #

    Hi
    I've this error 'Error establishing a database connection' site while instaling WP and I'm out of ideas what could be wrong.

    My host meets all the requirements, my database name is chlopczyk, user chlopczyk, pass is correct and database host is localhost
    -- my wp-config.php. ---
    define('DB_NAME', 'chlopczyk');
    define('DB_USER', 'chlopczyk');
    define('DB_PASSWORD', '*****');
    define('DB_HOST', 'localhost');
    -- -- -- -- -- --

    wp-config.php. 644
    I've access to my database (MySQL) only via commandline, I login and the databae exists. All is ok I think. So what could be wrong ?

  2. hbalagh
    Member
    Posted 9 years ago #

    it would need to be something like this

    define('DB_NAME', 'professional_pro');

    - professional being the username you use to get into cpanel (or what ever) and pro being the name of your db

    same thing for the db_user

  3. chlopczyk
    Member
    Posted 9 years ago #

    Could you give an example please :)

  4. hbalagh
    Member
    Posted 9 years ago #

    i thought i just did :)

    ok here is another example
    define('DB_NAME', 'chlopczyk_chlopczyk');

  5. chlopczyk
    Member
    Posted 9 years ago #

    ok changed
    define('DB_NAME', 'chlopczyk_chlopczyk');
    define('DB_USER', 'chlopczyk_chlopczyk');

    and it still isn't working :(

  6. hbalagh
    Member
    Posted 9 years ago #

    well is that the correct info?
    i don't know your servers username so i just put that there as an example

  7. chlopczyk
    Member
    Posted 9 years ago #

    My username is chlopczyk
    Database name is chlopczyk

    Do I need to change permissions on any file ?

  8. hbalagh
    Member
    Posted 9 years ago #

    so your name for your server ( to sign on to cpanel ) is chlopczyk

    and your username for the db is also chlopczyk????

    if this is the case
    your db_name should be chlopczyk_chlopczyk
    your db_user should be chlopczyk_chlopczyk

  9. If still in doubt, you may have to resort to asking your host.

  10. chlopczyk
    Member
    Posted 9 years ago #

    Correct, I login via shell on my account with login chlopczyk and my username for db is also chlopczyk. So I changed to

    define('DB_NAME', 'chlopczyk_chlopczyk');
    define('DB_USER', 'chlopczyk_chlopczyk');

    send it on the account and it still isn't working :(

    My host can't do a thing. Everything is working on his side...

    But I found something http://codex.wordpress.org/Installing_WordPress

    In 'Using the MySQL Client'
    I can't do this on my db
    GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname" IDENTIFIED BY "password";

    so maybe my host can help me or am I wrong ?

  11. chlopczyk
    Member
    Posted 9 years ago #

    I've installed WP on diffrent server and it worked, so it's my db privileges problem I think. I'll talk with my host to fix this :)

    Thanks for help :)

Topic Closed

This topic has been closed to new replies.

About this Topic