30.7 修改用户密码
MySQL支持使用mysqladmin命令修改用户的密码,可以在MySQL命令行使用SET PASSWORD语句修改用户的密码,也可以使用GRANT语句修改用户的密码,还可以直接修改user数据表来修改用户的密码。
30.7.1 通过mysqladmin修改用户密码
通过mysqladmin即可以修改root用户的密码,也可以修改普通用户的密码。
(1)使用mysqladmin将root用户的密码修改为root。
[root@binghe150 ~]# mysqladmin -u root -h localhost -p password "root" Enter password: mysqladmin: [Warning] Using a password on the command line interface can be insecure. Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
输入root用户的原密码即可将root密码修改为root。
(2)使用mysqladmin将binghe用户的密码修改为binghe。
[root@binghe150 ~]# mysqladmin -u binghe -h localhost -p password "binghe" Enter password: mysqladmin: [Warning] Using a passw



