登录MySQL数据库
然后
mysql> use mysql;
mysql> update user set password=password(‘123') where user='root' and host='localhost';
mysql> flush privileges;
退出,再次登录(使用新密码)
登录MySQL数据库
然后
mysql> use mysql;
mysql> update user set password=password(‘123') where user='root' and host='localhost';
mysql> flush privileges;
退出,再次登录(使用新密码)