Support » Localhost Installs » wordpress installation issue using xampp

  • Resolved Ravi-wpuser


    Well its not new, asked many times by other users…still I’m facing the same problem of error message “Error establishing a database connection” while trying to install wordpress using xampp as localhost.

    I’ve done everything from configuring wp-config.php file to setting up ‘wordpress’ name database and a user for it. Also have checked these things again and again in hope to resolve this issue, though its 🙁

    So here is what I’ve done in wp-config.php:

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'wordpress');
    /** MySQL database username */
    define('DB_USER', 'root');
    /** MySQL database password */
    define('DB_PASSWORD', '');
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');


    I wish, I could show you database and its user settings through images, but no facility given here.

    So after running xampp both Apache & MySQL, able to access successfully the database @ “http://localhost/phpmyadmin/index.php”

    I’m receiving error message “Error establishing a database connection” on both two ocassions:

    First, when I try to access following url:

    Second, when I try to access this url:

    One IMP note, I’ve installed XAMPP in my D: drive. Does this make any difference.

    Can somebody help me please!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p


    Error connecting to your database is common, but it isn’t necessarily a problem with wordpress itself.
    – double check your wp-config.php file settings for the database name, database username and database password. This is where most errors occur.
    – Then check that you don’t need to change the database host from “localhost” to something else. You can get that info from your hosting provider.
    – Check you have actually created a database with the same database name as is in your wp-config.php file.
    – There are also many threads on this topic on these forums:

    … and a user for it.

    There’s the issue. If you did in fact set up a db user in phpMyAdmin for the WP db, then use those credentials in the wp-config.php. What you show in your post is the XAMPP default db user and password: root and empty.

    I always use the local server’s default db user and password; why complicate things 🙂 You will have no issues using these if and when you move the site, either to another local server or a remote one. At least I never have in literally 100s.

    thx Tara & 2ninerniner2 for your guidance…I think I messed up somewhere putting my own pwd instead leaving it blank…and instead doing further troubleshooting, I went ahead with wamp this time and done successfully.

    @2ninerniner2, yes you are right in saying “why complicate things :)”

    Moderator t-p


    Glad you got it resolved 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wordpress installation issue using xampp’ is closed to new replies.