CentOS8中执行mysqladmin重置密码报错问题
报错现象:
connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: YES)‘
解决方案:
1,执行/etc/init.d/mysqld stop停止mysql服务
2,新开一个终端执行:mysqld_safe --skip-grant-tables &
3,在原来的终端执行命令:/usr/bin/mysql -uroot -p
进行无密码root账号登陆
此时提示输入密码直接Enter键
4,手动修改密码
mysql> use mysql;
Database changed
mysql> UPDATE user set password=password("root") where user=‘root‘ and host=‘localhost‘;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
再次登录:成功!
相关推荐
lpfvip00 2020-10-07
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11