Xampp Wordpress



  • I installed WordPress on XAMPP. I get an error: “Error establishing a database connection”. As far as I know, “The ‘Error establishing a database connection’ issue can be caused by incorrect database information in your WordPress settings, corrupt database, or an irresponsive database server.” (https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/)

    In wp-config.php I have:
    define(‘DB_NAME’, ‘wordpress’);
    /** MySQL database username */
    define(‘DB_USER’, ‘root’);
    /** MySQL database password */
    define(‘DB_PASSWORD’, ”);
    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    PhpMyAdmin starts up without any problem. The database is there and is called ‘wordpress’. config.inc.php file contains the following data:
    $cfg[‘Servers’][$i][‘user’] = ‘root’;
    $cfg[‘Servers’][$i][‘password’] = ”;
    $cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;

    So the database login credentials are correct, right? If yes, what else should I check?

    • This topic was modified 5 months, 2 weeks ago by . Reason: moved to 'localhost installs'

Because it's instant. If you need to merely learning PHP/MySQL locally, XAMPP is very suitable. However, XAMPP is not the only solution as you can install Apache & MariaBD manually. Download WordPress Software The software, WordPress, is actually a collection of PHP source code that integrated to form a website management system (WMS).

Bitnami

Xampp Wordpress Login

  • Hi there,

    Looking at the wp-config.php snippet you provided, it looks like you didn’t use a password or removed it to post it here. If you didn’t you a password please try the following. After define(‘DB_PASSWORD’, there is a ' instead of '. Please change this.

    IF you removed the password form the snippet, please double check the password in the wp-config.php. This may sound redundant, but I have seen it happen before that a typo slipped in.

    I hope this helps.

    Regards,
    Arno

    If this is a Windows-based system, you should never use localhost for the MySQL hostname in a PHP application. Your snippet from phpMyAdmin provides the answer: use 127.0.0.1 for the hostname.

    Also make sure your Windows firewall isn’t blocking port 3306 because it will be used by MySQL.

    If that’s the case, then you will need this for the hostname:

    define(‘DB_HOST’, ‘127.0.0.1:3307’);

    Your firewall should be fine since phpMyAdmin is successfully accessing MySQL on port 3307.

Xampp Wordpress Slow

  1. You can easily install WordPress on XAMPP. XAMPP can help you to setup localhost on your PC with the help of PHP, MySQL, and Apache. Don’t be afraid if you do not know any of them. You don’t need to know them to have a fully working localhost on your PC.
  2. Choose a Local Server Environment. In order to get a working installation of WordPress going on.
  3. The first step on your way to install WordPress locally is to download and install the XAMPP software. You can download the Windows installer file from Apache Friends. It's a big file.