当前位置:网站首页>ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
2022-07-29 06:29:00 【m0_67394006】
事情起源
前天晚上好好的,第二天打开电脑正要开始写垃圾代码时,发现项目启动报错了,看了一下,发现是数据库连不上,我一脸懵逼,只能上csdn搜索大佬的文章,最后解决了问题。下面的过程是本人执行大佬教程时出现的问题并进行解决的过程。本人mysql版本如下:mysql-8.0.27-winx64。
操作
一、新建第一个cmd窗口,关闭mysql服务

二、新建第二个cmd窗口(管理员权限打开),跳过权限验证
mysqld --console --skip-grant-tables --shared-memory

三、新建第三个cmd窗口(管理员权限打开),无密码进入mysql,并清空密码
看到Enter passowrd直接爱搭不理,回车就行
update user set authentication_string='' where user='root';

四、关闭前面的cmd窗口(管理员权限打开),无密码进入mysql,并重置密码

前面一切顺利,当我要修改密码的时候,又给我报错了,说我密码太简单,开玩笑,“12345678”还简单,算了,只能修改mysql的规则了。
打开配置
发现policy是中等的
那就改成低级的吧
set global validate_password.policy=0;

再次执行 mysql> show variables like “%validate%”; 发现修改完成
总算可以修改密码了,开搞
啊这,又报错,我心态崩了啊。最后在查了其他资料之后,发现了新的修改方法。
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '12345678';

修改完成之后可以正常登录了
参考博客
https://blog.csdn.net/m0_46278037/article/details/113923726spm=1001.2014.3001.5502
边栏推荐
- Excerpts from good essays
- Junda technology | applicable to "riyueyuan" brand ups wechat cloud monitoring card
- VMware16安装虚拟机遇到的问题
- Can MySQL export tables regularly?
- 模拟卷Leetcode【普通】093. 复原 IP 地址
- 基于C语言设计的学籍管理系统
- 聊天机器人有何用处?有何类型?看完这些就明白了!
- SSH password free login - two virtual machines establish password free channel two-way trust
- Teacher wangshuyao's notes on operations research course 08 linear programming and simplex method (simplex method)
- Flink real-time warehouse DWD layer (transaction domain - additional purchase dimension degradation processing) template code
猜你喜欢

Student status management system based on C language design

ECCV 2022 lightweight model frame Parc net press apple mobilevit code and paper Download

Vmware16 create virtual machine: cannot create a new virtual machine, do not have permission to perform this operation

Improved pillar with fine grained feature for 3D object detection paper notes

Vscode remote debugging PHP solution through remotessh and Xdebug

聊天机器人有何用处?有何类型?看完这些就明白了!

WPF 界面布局必知基础

我的个人网站不让接入微信登录,于是我做了这个

Vmware16 create virtual machine: win11 cannot be installed

使用VsCode配置MySQL实现连接、查询、等功能
随机推荐
网上传说软件测试培训真的那么黑心吗?都是骗局?
MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
基于C语言设计的学生成绩排名系统
个人博客系统(附源码)
330. 按要求补齐数组
Teacher Wang Shuyao's notes on operations research 09 linear programming and simplex method (Application of simplex table)
Idea cannot find a database solution
CAN&CANFD综合测试分析软件LKMaster与PCAN-Explorer 6分析软件的优势对比
模拟卷Leetcode【普通】222. 完全二叉树的节点个数
Thread - thread safety - thread optimization
Teacher Wu Enda machine learning course notes 01 introduction
【Redis】Redis开发规范与注意事项
mysql查询区分大小写
Vmware16 create virtual machine: cannot create a new virtual machine, do not have permission to perform this operation
竣达技术 | 适用于”日月元”品牌UPS微信云监控卡
Hj37 statistics of the total number of rabbits per month Fibonacci series
vim文本编辑器的一些使用小技巧
Simulation volume leetcode [normal] 081. Search rotation sort array II
[C language brush leetcode] 2332. The latest time to get on the bus (m)
2022-07-28:以下go语言代码输出什么?A:AA;B:AB;C:BA;D:BB。 package main import ( “fmt“ ) func main() { f