- 登录
mysql -u root -p
- 切换数据库
USE mysql;
- 修改root账号密码
update mysql.user set authentication_string=password("自定义密码") where user='root';
- 刷新权限
flush privileges;
- 退出
quit
mysql -u root -p
USE mysql;
update mysql.user set authentication_string=password("自定义密码") where user='root';
flush privileges;
quit