Support » Installation » Error establishing a database connection

Error establishing a database connection

  • 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 ?

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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

    Could you give an example please 🙂

    i thought i just did 🙂

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

    ok changed
    define(‘DB_NAME’, ‘chlopczyk_chlopczyk’);
    define(‘DB_USER’, ‘chlopczyk_chlopczyk’);

    and it still isn’t working 🙁

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

    My username is chlopczyk
    Database name is chlopczyk

    Do I need to change permissions on any file ?

    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

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

    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 ?

    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 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.