lnmp 重置 MySQL 的密码
昨天遇到的问题,公司的一个lnmp环境的机器忘记了 MySQL 的root密码,然后就呵呵呵呵呵。。。
下面其实就是记一下重置的过程
1.停掉LNMP
lnmp stop
2.修改MySQL配置文件
vim /etc/my.cnf
在[mysqld]
后面加入一行,停到密码验证
skip-grant-tables
3.重新启动LNMP
lnmp start
4.修改密码
mysql
update user set Password = password ( '123456' ) where user = 'root';
5.重启LNMP
lnmp restart