查看默认密码
1. 查找日志目录
find / -name mysqld.log
2. vim 查看
3. 搜索password关键字
修改密码
1. 使用默认密码登陆
2. 修改密码
MySQL5.7及以下版本:update mysql.user set authentication_string=password('xxxxxx') where user='root';
其他版本:update user set password=password('xxxxxx') where user='root';
3. 立即生效
flush privileges;