mysql密码丢失
vi /etc/my.cnf
skip-grant-tables
重启mysql服务
直接mysql进入数据库
mysql> use mysql
mysql> update user set authentication_string=password(‘root’) where user=“root” and host=‘localhost’;
flush privileges;
出来后再修改/etc/my.cnf回去,重启mysql服务
mysql -uroot -p123456 -e “grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;”
mysql -uroot -p123456 -e “flush privileges;”