WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wordpress installation issue using xampp (5 posts)

  1. Ravi-wpuser
    Member
    Posted 7 months ago #

    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:
    http://localhost/wordpress/

    Second, when I try to access this url:
    http://localhost/wordpress/wp-admin/install.php

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

    Can somebody help me please!

  2. Tara
    Member
    Posted 7 months ago #

    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: http://wordpress.org/search/Error+establishing+a+database+connection?forums=1

  3. 2ninerniner2
    Member
    Posted 7 months ago #

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

  4. Ravi-wpuser
    Member
    Posted 6 months ago #

    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 :)"

  5. Tara
    Member
    Posted 6 months ago #

    Glad you got it resolved :-)

Reply

You must log in to post.

About this Topic