方法1:用UPDATE直接编辑user表
首先登录MySQL。
mysql> use mysql;
mysql> update user set password=password('root') where user='root' and host='localhost';
mysql> flush privileges;
首先登录MySQL。
mysql> use mysql;
mysql> update user set password=password('root') where user='root' and host='localhost';
mysql> flush privileges;