sudo vim /etc/mysql/mysql.conf.d/cnf
忘记密码时:
1.输入skip-grant-tables
2. mysql> USE mysql ;
mysql> UPDATE user SET Password = password ( ‘new-password‘ ) WHERE User = ‘root‘ ;
mysql> flush privileges ;
mysql> quit
3.注释掉
bind-address = 127.0.0.1