1、cmd中登录mysql
输入命令:mysql -u root -p

2、进入mysql登录界面Enter password,输入原密码

3、成功进入mysql管理命令界面
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 816
Server version: 5.5.57 MySQL Community Server (GPL)

4、用命令格式:mysql> set password for 用户名@localhost = password('新密码');
如mysql> set password for root@localhost = password('123'); ,

5、执行命令后,返回:Query OK, 0 rows affected (0.02 sec)
说明密码成功修改

6、可以用新密码测试登录