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 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.
输入binghe用户的原密码即可将密码修改为binghe。