当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
MutationObserver文档学习
Excerpts from good essays
Analog volume leetcode [normal] 093. Restore IP address
ECCV 2022 lightweight model frame Parc net press apple mobilevit code and paper Download
ETL为什么经常变成ELT甚至LET?
Junda technology | applicable to "riyueyuan" brand ups wechat cloud monitoring card
数组的子集能否累加出K
竣达技术 | 适用于”日月元”品牌UPS微信云监控卡
模拟卷Leetcode【普通】172. 阶乘后的零
npm install报错npm ERR Could not resolve dependency npm ERR peer
Federal learning backdoor attack summary (2019-2022)
二次元卡通渲染——进阶技巧
CAN&CANFD综合测试分析软件LKMaster与PCAN-Explorer 6分析软件的优势对比
fillder使用
Teacher Wu Enda's machine learning course notes 00 are written in the front
leetcode-592:分数加减运算
buck电路boot电容短路和断路实测波形
npm install 时,卡住不动,五种解决方法
Guess the number / / generate a random number for the first time









