mysql修改密码

登录MySQL

use mysql;

5.7之前

update user set password=password("root@123") where user="root";


flush privileges;

5.7之后

update user set authentication_string=password("123456") where user="root";


flush privileges;

然后重新登录