用UPDATE直接编辑user表
首先登录MySQL。
C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin>mysql -u root -p
mysql> use mysql;
mysql> update user set password=password(‘123’) where user=‘root’ and host=‘localhost’;
mysql> flush privileges;
用UPDATE直接编辑user表
首先登录MySQL。
C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin>mysql -u root -p
mysql> use mysql;
mysql> update user set password=password(‘123’) where user=‘root’ and host=‘localhost’;
mysql> flush privileges;