How to change the MySQL root user password (Windows)

How to change the MySQL root user password (Windows)

  1. Start your command line by going to the Start Menu > Run and typing cmd (or type command if you are using an older version of windows)
  2. Change directory to where you installed mysql to:
    C:> cd C:mysqlbin
  3. Switch to mysql command line:
    C:mysqlbin> mysql -u root mysql
  4. Then set a default password:
    mysql> SET PASSWORD FOR root@localhost=PASSWORD('newpass');
    where "newpass" is the password you want to use