参考链接:https://www.jianshu.com/p/145aec4047dc
mysql密码忘记了怎么办?
vim /etc/my.cnf
## 在配置段[mysqld]下面添加如下一行后,重启mysql,就可以免密码登录mysql了
skip-grant-tables
开始修改密码
mysql> update mysql.user set authourian_string=password('yourpasswd') where user='';
mysql> flush privileges;