• Resolved DJL

    (@djl)


    I keep getting the message that there is an “Error establishing a database connection”. As I understand the wp-config-sample.php file (which I have renamed “wp-config.php” before uploading) I only have to enter name of the database, username and password. See below (password written in letters in my file, of course). Do I have to fill in somthing in “define(‘DB_COLLATE’, ”);”
    as well?

    <?php
    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘viarecta_dk_db’); // The name of the database
    define(‘DB_USER’, ‘viarecta’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘********’); // …and password
    define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
    define(‘DB_CHARSET’, ‘utf8’);
    define(‘DB_COLLATE’, ”);

Viewing 15 replies - 1 through 15 (of 19 total)
  • I only have to enter name of the database, username and password.

    And, eventually, the DB_HOST (aka database server) – because it is not always “localhost”.

    What is the exact error message you get? (there are more than one)

    Thread Starter DJL

    (@djl)

    Full error 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.

    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.

    the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost

    If you are sure that the username and pw is correct – then the only issue is with “localhost”.
    Check in your hosts site admin panel (where you created the DB) what should be the database server or mysql server.

    Thread Starter DJL

    (@djl)

    I am sure about username and password. I didn’t create the DB myself. It was already there – or maybe my old webmaster created it. Anyhow, when I log in to the MySQL admin it says:

    Server: Localhost via UNIX socket

    Writing “Localhost via UNIX socket” in the file didn’t work either.

    Another thought: does the db user have all the privileges? and, more importantly, did you add the user to the db?

    Thread Starter DJL

    (@djl)

    Ehhhmm. I’m afraid you lost me there. I’ve always logged into the DB with the same user and pw and so did my webmaster. there is only this one user and pw.

    Thread Starter DJL

    (@djl)

    Actually, unless you make a backup of your data, for installing WP there is no need to login into the DB.

    So, what kind of site admin is offered by your host?
    cPanel? Plesk? something else?
    Who is your host? – there are always control panel specific and/or host specific info if we/you know what are you looking for.

    I am having the same problem. I’ve gone through all the steps and nothing is working.

    isleo1,

    don’t double post – keep it in your own thread!

    Thread Starter DJL

    (@djl)

    my host is a Danish webhotel host called wannafind.dk. I log in on the site mysql8.wannafind.dk and then I enter a site which is pretty basis to look at. It says “Localhost” and “phpMyAdmin – 2.11.1” as headlines…. don’t know if this is the right word in English.

    I only logged into the db to be sure about username and pw. I honestly don’t know what “plesk” or “cPanel” is…. sorry.

    Did you try this instead of “localhost”
    mysql8.wannafind.dk ?

    You log in to mysql8.wannafind.dk? Then that’s presumably your database server. Substitute “localhost” with that URL (“mysql8.wannafind.dk”).

    Thread Starter DJL

    (@djl)

    Moshu, I could kiss you! “welcome” now appears on my screen!

    Thank you!

    Hmm… Is this the domain linked to your profile here?
    If I click on it it goes to the install.php file, which is bad – anybody could overwrite your installation.

    As a temporary solution, remove the install.php file!

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘Error establishing a database connection’ is closed to new replies.