首先拿到操作系统的root权限,然后kill掉Mysql服务或者手动stop掉,这里我推荐使用手动stop;
service mysql stop
mysqld_safe --skip-grant-tables &
启动MySQL:systemctl start mysqld.service
进入MYSQl: mysql -u root
使用数据库: use mysql;
修改数据库密码为空: update user set password=password("") where user="root";
exit;
Linux 将数据库密码重置为空
最新推荐文章于 2024-08-14 21:58:44 发布