admin管理员组

文章数量:1648020

环境为虚拟机centos7 mysql - u root -p进入mysql时报了这个错误 ,看了网上的帖子说密码输错三次被锁或者不改密码超过期限自动锁定 ,我的应该是因为我把mysql中的user表里一个account_locked字段由‘N’改成了‘Y’ 然后重启了服务,结果进不去了,我还只有这一个账号,具体解决办法如下:
1.进入myf修改文件:

vim /etc/myf

增加一句代码,让mysql跳过密码验证直接登陆:

skip-grant-tables

保存后直接输mysql可以登录进去

[root@localhost etc]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.22 MySQL Community Server - GPL

本文标签: 时报ErrormysqlAccesslocalhost