
MySQL 5.7 修改密码方法
1、 update 方法
为了提高安全性 mysql5.7中user表的password字段已被取消,取而代之的事 authentication_string 字段,所以通过update方法修改密码的语句如下:
mysql> update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
mysql> flush privileges;
2、 alter方法
mysql> alter user 'root'@'localhost' identified by '123456';
mysql> flush privileges;
3、 set 方法
mysql> set password for 'root'@'localhost'=password('123456');
mysql> flush privileges;