- 安装初始没有密码,可直接进入数据库:
mysql -uroot -p
- 选择mysql数据库:
use mysql
- 将authentication_string置空:
update user set authentication_string='' where user='root';
- 查询user表:
select user,host from user;
- 修改想要修改的用户和主机组合所需的密码:
alter user 'root'@'localhost' identified by '新密码';
【mysql】mysql8修改密码
最新推荐文章于 2024-03-06 10:34:07 发布