windows系统下的mysql 8.0 修改密码、创建用户

https://blog.csdn.net/qq_40015409/article/details/111583235
1.以管理员权限运行cmd


2.停止服务
net stop mysql // 不需要关闭服务


3.cd mysql安装目录


4.mysqld --console --skip-grant-tables --shared-memory


5.新开一个以管理员权限运行cmd


6.flush privileges;
参考:
https://zhuanlan.zhihu.com/p/63634699


7.use mysql;


8.select host,user,plugin,authentication_string from user;
或 show variables like 'default_authentication_plugin';


9.alter user 'root'@'localhost' identified with mysql_native_password by '123456'; //此时密码仍是加密的的密码
update user set authentication_string='123456' where user=root'; //此时密码为123456
// MySQL8下忘密码后重置密码的办法

 

10.创建远程登录用户
create user 'remote'@'%' identified by '123456';


11.修改用户密码为本地密码
alter user 'remote'@'%' identified mysql_native_password by '123456';


12.update user set authentication_string='123456' where user=remote'; //不能用此sql语句更改密码为123456

 

13. https://cloud.tencent.com/developer/ask/130030 password_expired='N'
参考:https://www.iteye.com/blog/venus224-998476

 

14.grant all privileges on *.* to 'root'@'localhost' identified by '123456';
参考:
https://jingyan.baidu.com/article/f7ff0bfcb914916e26bb13ac.html
https://www.iteye.com/blog/venus224-998476

posted @   明月忧忧  阅读(430)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
历史上的今天:
2014-01-10 属性的字符串表示形式“<%=Value %>"创建“System.Int32”类型的对象。
点击右上角即可分享
微信分享提示