Mysql5.7.14 linux版密码忘记完美解决办法
在/etc/my.conf文件中[mysqld] 下面最后增加一行:skip-grant-tables
记住是[mysqld]下最后,不要增加到[mysqld_safe
]下面
保存之后,重启Mysql,在linux命令行直接执行:mysql回车
OK
修改密码:
update mysql.user set password=password('root') where user='root'
结果报错:
mysql> select host,user,password from user ; ERROR 1054 (42S22): Unknown column 'password' in 'field list' desc user;
查看字段发现没有password字段,有authentication_string
字段
update mysql.user set authentication_string=password('root') where user='root' ;
ok
删除/etc/my.conf文件中[mysqld] 下面的skip-grant-tables
重启mysql
总结
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20