resetting xampp mysql password

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

resetting xampp mysql password

Postby unixadmin » 10. December 2008 23:58

Guys,
I am not able to reset MySQL root password,
mysqld_safe --skip-grant-tables & this command is not working.. please suggest


thanks
tanweer
unixadmin
 
Posts: 5
Joined: 10. December 2008 23:44

Re: resetting xampp mysql password

Postby Wiedmann » 11. December 2008 00:02

Never test this in the last months... but is the batchfile "resetroot.bat" not working?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: resetting xampp mysql password

Postby Sharley » 11. December 2008 00:17

If the .\xampp\mysql\resetroot.bat file fails - which it has in the past, sort out a method below that best suits your needs that gives the required result.

Did you try in http://localhost under menu item Security then click the link:
http://localhost/security/xamppsecurity.php --> MYSQL SECTION: "ROOT" PASSWORD
You will need to know your original MySQL password for this part to work.

If you don't have the original MySQL root user password then here is a clip from my KB (may seem long winded but was first compiled for an absolute new user).
Sharley's KB wrote:Make sure that MySQL is stopped and the MySQL service is uninstalled if you have the service installed

We will need to open 2 Command Console Windows in the xampp\mysql\bin directory and run some commands.

Just in case you are not familiar with how to do that please try and follow these instructions.

Open the first Console Window:
Click on start bottom left of the Windows Task Bar
Click on Run...
Type cmd.exe
Click OK
type cd C:\xampp\mysql\bin (change to your own path)
Press Enter
At the prompt bin> type mysqld --skip-grant-tables
The cursor should now be just flashing on a blank line waiting.
Leave that Console Window open and go to open the second Console Window.


Next, open the second Console Window:
Click on start on the Task Bar again
Click on Run...
Type cmd.exe
Click OK
type cd C:\xampp\mysql\bin (change to your own path)
Press Enter
At the prompt bin> type mysql -u root
Press Enter
At the prompt mysql>type all this UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
Press Enter
At the prompt mysql>type FLUSH PRIVILEGES;
Press Enter
At the prompt mysql>type exit
Press Enter
You should be back at the bin>prompt and job done.

Now just close both Console Windows.

Your MySQL and phpMyAdmin will have user root with password password as set by this part of the above command:
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
If you want to change from password to a new one of your choice, just change password in between the single quotes to the new one of your choice for example:
UPDATE mysql.user SET Password=PASSWORD('mynewpass') WHERE User='root';

Now open the XAMPP Control Panel and you should see that MySQL is already started - just start Apache now, and to test that the password has indeed changed go to:
http://localhost/phpmyadmin
Enter Username: root and Password: password (or your new password of choice)
click Go
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 158 guests