*root*用户权限大,可以修改很多用户的密码
mysql> update user set password=
PASSWORD(
'test') where user=
'test';
Query
OK,
1 row affected (
0.
00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query
OK,
0 rows affected (
0.
00 sec)
*test*用户
*查看test用户的权限
mysql> show grants for test
@localhost;
+--------------------------------------------------------------------------------------------------------------------------------------+
|
Grants for test
@localhost |
+--------------------------------------------------------------------------------------------------------------------------------------+
|
GRANT
SELECT,
INSERT,
UPDATE,
DELETE
ON *.*
TO
'test'@
'localhost'
IDENTIFIED
BY
PASSWORD
'*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' |
+--------------------------------------------------------------------------------------------------------------------------------------+
*修改密码:
mysql> update user set password=PASSWORD('root') where user='test';