MySql修改密码

用户名为cmmroot并且主机名为%的用户密码修改成了mm1234
实例:
mysql> update user set password=password('mm1234') where user='cmroot' and host='%';
Database changed
Rows matched: 1 Changed: 0 Warnings: 0
mysql>
2、例子
例1:给root加个密码123456。
键入以下命令 :
[root@test1 local]# /usr/bin/mysqladmin -u root password 123456
注:因为开始时root没有密码,所以-p旧密码一项就可以省略了。