数据库密码忘记?
步骤1 启用一下数据
vi my.cnf 启用一下数据
#[mysqld]
#skip-grant-tables
步骤2 重启数据库
systemctl stop mysqld.service
systemctl start mysqld.service
步骤三 登录数据库,密码直接跳过回车
mysql -u root -p
use mysql;
flush privileges;
select user,plugin from user where user='root';
select user,host from user; ####################选择 host 为%的用户
alter user 'root'@'%' identified with mysql_native_password by 'your password';
步骤四 重启数据库
systemctl stop mysqld.service
systemctl start mysqld.service



