MySQL用户密码修改 第一种方法:(推荐使用) mysql> alter user root@'localhost' identified by '123'; mysql> flush privileges; 第二种方法: mysql> set password=PASSWORD('123'); mysql> flush privileges; mysql> set password for root@localhost=password('123'); mysql> flush privileges; 第三种方法: mysql> use mysql; mysql> update user set password=password('123') where user='root' and host='localhost'; mysql> flush privileges; mysql> use mysql; mysql> update user set authentication_string=password('123') where user='root' and host='localhost'; mysql> flush privileges; 第四种方法: [root@db01 ~]# mysqladmin -uroot -p123456 password 123 第五种方法: mysql> grant all on *.* to root@'10.0.0.%' identified by '123'; mysql> flush privileges; 第六种方法: 在创建用户的时候赋予密码 mysql> create user 'win7'@'10.0.0.%' identified by '123';