Linux下MySQL忘记密码后进行重置密码
1、找到数据库配置文件,位置/etc/my.inf
,在mysqld中添加跳过验证指令
skip-grant-tables
2、重启mysql服务,mysqld和mysql根据系统自行选择
systemctl restart mysql.service
3、使用无密码登录mysql
mysql -u root
4、重置密码
use mysql;
update mysql.user set authentication_string=password('your_password') where user='root';