mysql 5中修改密码

mysql> use mysql
Database changed
mysql> select host,user from user;
+-----------+------+
| host      | user |
+-----------+------+
| %         |      |
| %         | root |
| localhost |      |
| localhost | root |
+-----------+------+
4 rows in set (0.02 sec)

mysql> update user set password=password('newpassword') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)

你可能感兴趣的:(mysql)