SET PASSWORD [FOR `username`@`host`]= PASSWORD("newpassword")
例子
把ua的密码改成123
mysql> set password for `ua`@`localhost`=password("123");
Query OK, 0 rows affected (0.00 sec)
mysql>
修改密码后,使用新密码登陆
C:\Users\Administrator>mysql -uua -p123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
非超级管理员 自己改自己的密码
首先要登陆到自己的帐号中
然后输入命令
mysql> set password = password("abc");
Query OK, 0 rows affected (0.00 sec)