• Hello.

    I’d welcome a little advice.

    I have installed WordPress on my localhost using XAMPP.

    I was able to log in to my Admin.

    In order to make XAMPP more secure, I followed the instructions at the bottom of this message.

    I now cannot access WordPress as it says: “Error establishing database connection”.

    I know that trying to make XAMPP secure has disabled WordPress, but I am not sure how or why.

    Could someone please advise me how I can enable access to WordPress on my localhost?

    Is there a way to make XAMPP secure AND enable WordPress on my localhost?

    Thank you in advance.

    BG


    PROCEDURE FOLLOWED

    Start Apache and MySQL and go to https://localhost in your browser (on the same machine as your server). If this is your first time browsing the local site, you should now see a webpage with the XAMPP logo and a choice of languages. Click on your preferred language.

    This brings you to an XAMPP control page with navigation links in the left sidebar. Click on “Security”. The page may take a moment to load, it is checking your security status. After it loads, you will see various states of your security status and how your server is currently insecure.

    To fix the first 3 problems listed on this page (XAMPP pages publicly accessible, mySQL has no password, and phpMyAdmin is freely accessible), scroll down until you see this link: https://localhost/security/xamppsecurity.php. Click on that link. If you don’t have that link, click here to bring you to that page on your local server.

    You’ll now see a page titled “Security console MySQL & XAMPP directory protection”. Do the following:

    1. Enter a password (2 times) for the MySQL SuperUser (root)
    2. Select “cookie” for “PhpMyAdmin authentification” (this is the default, and I prefer it over http authentification).
    3. Do not check “Safe plain password in text file?”
    4. Record this password in a safe place so you don’t forget it.
    5. Click the button “Password changing”.

    If done correctly, you should get this message “The root password was successfully changed. Please restart MYSQL for loading these changes!”. Go ahead and restart MySQL via the XAMPP control panel (stop it and then start it again).

    Now, back on the XAMPP security page, scroll down to “XAMPP DIRECTORY PROTECTION (.htaccess)”. Do the following:

    1. Enter a username.
    2. Enter a password.
    3. Leave unchecked “Safe plain password in text file? “
    4. Record the username/password in a safe place so you don’t forget it.
    5. Click the button “Make safe the XAMPP directory”

    Check that it was successful by looking above the “XAMPP DIRECTORY PROTECTION (.htaccess)” for this message: “SUCCESS: The XAMPP directory is protected now! All personal data was safed in the following file: C:\xampp\security\xampp.users C:\xampp\htdocs\xampp\.htaccess”.

    In the future, you can use this page again to change your MySql password, but I don’t recommend using it for your XAMPP password since it will erase any users that you may have added for XAMPP access. If you are the only user for the XAMPP pages, then it is ok to use this form to enter a new password.

    You can relaunch the security page to see what XAMPP thinks of your security now. To do this, click on “Security” in the left sidebar. The top 3 items should indicate “Secure” now. If not, you have an issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi.. you probably solved this issue already.. right?

    If yes, share what you did to solve it ??

    else I’ll post a solution for you ??

    It’s been a while after your post. I am sure you are out of the woods. I am writing this only for the sake of completion.
    Here is a quote from the XAMPP readme file:

    After changing the password you’ll have to reconfigure phpMyAdmin to use the new password, otherwise it won’t be able to access the databases. To do that, open the file config.inc.php in \XAMPPlite\phpmyadmin\ and edit the following lines:

    $cfg[‘Servers’][$i][‘user’] = ‘root’; // MySQL User
    $cfg[‘Servers’][$i][‘auth_type’] = ‘http’; // HTTP authentification

    This will let you go into the WP admin area successfully.

    However, to access your site directly by typing https://localhost/wordpress/ (I am presuming that you chose the database name as ‘wordpress’), you may still get an error. For this:

    Open the wp_config.php file in the ‘wordpress’ directory. Check out the following lines:

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // The name of the database
    define(‘DB_USER’, ‘root’); // 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’, ”);

    Add the password accordingly. Leave the user-name as it is. This is “admin” by default. You may have set a new one in the settings areas of your WP install.

    Hope this helps all.
    -SH

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Securing XAMPP on localhost has disabled WordPress- help please’ is closed to new replies.