Resetting MySQL Root Password with XAMPP on Localhost
To reset the root password for MySQL on XAMPP, you can follow these steps:
- Stop the MySQL service in XAMPP.
- Open a command prompt and navigate to the folder where XAMPP is installed (e.g., C:\xampp\mysql\bin).
- Run the following command: mysqld --skip-grant-tables
- Open another command prompt and navigate to the same folder as above.
- Run the following command to log in to MySQL as the root user: mysql -u root
- At the MySQL prompt, run the following command to reset the root password:
UPDATE mysql.user SET Password=PASSWORD('your_new_password') WHERE User='root';
FLUSH PRIVILEGES;
Watch a video course
Learn object oriented PHP
- Replace "your_new_password" with the password that you want to use for the root user.
- Quit the MySQL prompt by running the following command: quit
- Stop the MySQL server by pressing Ctrl + C in the command prompt where you started it with the --skip-grant-tables option.
- Start the MySQL service in XAMPP.
You should now be able to log in to the MySQL server using the new root password.