修改root用户的的密码。
由于mysql5.7没有password字段,密码存储在authentication_string字段中,password()方法还能用

在mysql中执行下面语句修改密码

show databases;
 
use mysql;
  
update user set authentication_string=PASSWORD("yourpassword") where user='root';
  
update user set plugin="mysql_native_password";
  
flush privileges;
  
quit;

 

相关文章: