su mysql
mysqld
--skip-grant-tables
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
alter user user() identifity by '123qwe';
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY '123qwe' WITH GRANT OPTION;
flush privileges;
quit;
本文介绍了一种在不使用密码的情况下重置MySQL根用户的密码的方法。通过使用--skip-grant-tables选项启动mysqld服务,然后更新mysql.users表中的authentication_string字段,并通过grant语句重新授予root用户所有权限。
5293

被折叠的 条评论
为什么被折叠?



