一、登录有问题的数据库
sudo mysql -uroot -pxxx -hkde-offline1 -P13306
二、查询user表
这将显示与 root 用户关联的主机、用户名以及加密后的认证字符串(密码)。请注意,authentication_string
列中存储的是经过哈希加密后的密码,而不是原始密码。
MySQL [mysql]> select * from mysql.user\G;
MySQL [mysql]> SELECT host, user, authentication_string FROM mysql.user WHERE user = 'root' AND host = 'localhost';
+-----------+------+-------------------------------------------+
| host | user | authentication_string |
+-----------+------+-------------------------------------------+
| localhost | root | *B8C8E3C592483sssC0CDAC72D5FC3EE6548F7E25 |
+-----------+------+----------------------