MYSQL SECTION: "ROOT" PASSWORD not working with localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

MYSQL SECTION: "ROOT" PASSWORD not working with localhost

Postby damole » 02. October 2014 16:51

I just installed xampp-win32-1.8.3-3-VC11 but I cannot change the root password. I enter my password twice and click the password changing button and the message "The root password was successfully changed. Please restart MYSQL for loading these changes!" but when I stop and start MySQL in the XAMPP control panel and then click admin I am logged into myphpadmin without being asked for a password and the security section of localhost/xampp says no password has been set.

I've installed XAMPP many times before on many computers but this is the first time this has happened.

Any ideas?
Last edited by damole on 16. October 2014 01:04, edited 1 time in total.
damole
 
Posts: 4
Joined: 30. April 2014 10:49
Operating System: Windows 7

Re: MYSQL SECTION: "ROOT" PASSWORD not working

Postby damole » 03. October 2014 09:31

I just realised that this is the first time using Windows 8.(1) as opposed to 7. I've been reading lots of posts which might point to an issue with how localhost works in Windows 8.
damole
 
Posts: 4
Joined: 30. April 2014 10:49
Operating System: Windows 7

Re: MYSQL SECTION: "ROOT" PASSWORD not working

Postby damole » 10. October 2014 11:35

I found a line in securefunctions.php that tried to open the database with localhost instead of 127.0.0.1. When I changed this everything worked OK.

Original

Code: Select all
securefunctions.php:line 11    if (@mysql_connect("localhost", "root", "$currentpass")) {


changed
Code: Select all
        global $host;
        if (@mysql_connect($host, "root", "$currentpass")) {


where $host a previously defined and used variable has already been assigned the value "127.0.0.1".
damole
 
Posts: 4
Joined: 30. April 2014 10:49
Operating System: Windows 7

Re: MYSQL SECTION: "ROOT" PASSWORD not working

Postby damole » 15. October 2014 08:14

The status page of my install was displaying, "MySQL database DEACTIVATED", after changing the code as below it now correctly shows as activated.

From ..\htdocs\xampp\mysql.php

Code: Select all
if (@mysql_connect("localhost", "pma", "")) {   


changed to

Code: Select all
if (@mysql_connect("127.0.0.1", "pma", "")) {
damole
 
Posts: 4
Joined: 30. April 2014 10:49
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 129 guests