Very Important!
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.exeClick
OKtype
cd C:\xampp\mysql\bin (
change to your own path)
Press
EnterAt the prompt bin> type
mysqld --skip-grant-tablesThe 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.exeClick
OKtype
cd C:\xampp\mysql\bin (
change to your own path)
Press
EnterAt the prompt bin> type
mysql -u rootPress
EnterAt the prompt mysql>type all this:
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';Press
EnterAt the prompt mysql>type
FLUSH PRIVILEGES;Press
EnterAt the prompt mysql>type
exitPress
EnterYou 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/phpmyadminEnter Username:
root and Password:
password (
or your new password of choice)
click
GoAlternatively, if you want to change the password using the XAMPP facility.
Go to
http://localhost/security/xamppsecurity.php and use the facility there to change the
root user password in the normal way - enter Current Password:
password (
or your new password of choice), then New password: and Repeat the new password.
Job done!