进入mysql数据库,修改数据库的内容
1, use mysql;
2,update user set authentication_string="" where User='root';//设 authentication_string 为空值 ,因为是连接这个加密的东西
先设密码为空
3,update user set plugin="mysql_native_password";
4,flush privileges;
5,quit;
然后重启MySQL。
6,接着在命令行修改root用户密码,
ALTER USER 'root'@'%' IDENTIFIED BY 'dpxxabc123';
flush privileges;
----------------------------
# 修改密码过期规则----》永不过期
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
#修改密码
ALTER USER 'root'@'%' IDENTIFIED BY 'dpxxabc123';
#远程可访问
update user set Host='%' where User='mysql.infoschema';
该文介绍了如何进入MySQL数据库并修改root用户的密码,包括将密码设置为空、启用mysql_native_password插件、刷新权限,以及设置密码永不过期和允许远程访问的步骤。
3万+

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



