How to change MySQL root password on Windows

Change directory to where you installed mysql to:

C:\> cd C:\mysql\bin

Switch to mysql command line:

C:\mysql\bin> mysql -u root mysql

Then set a default password:

mysql> SET PASSWORD FOR root@localhost=PASSWORD('newpass');

where “newpass” is the password you want to use.

Then then add your new user:

mysql> CREATE USER 'stefano'@'localhost' IDENTIFIED BY 'mypass';