当前位置:网站首页>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
边栏推荐
- Decompilation of wechat applet
- DM data guard cluster setup
- Unity发送Post请求给GoLang服务端解析并返回
- Leetcode-1331: array ordinal conversion
- dba
- 模拟卷Leetcode【普通】172. 阶乘后的零
- Flink real-time warehouse DWD layer (processing complex data - installation and replacement of streams and tables) template code
- 个人博客系统(附源码)
- gin 路由,参数,输出
- Teacher Wu Enda's machine learning course notes 00 are written in the front
猜你喜欢

基于C语言实现图书借阅管理系统

Guess the number / / generate a random number for the first time

Revolution of game assets

Excel文件读写(创建与解析)

Basic knowledge of MySQL (high frequency interview questions)

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

Some tips of vim text editor

Student status management system based on C language design

Windows 上 php 7.4 连接 oracle 配置

基于C语言设计的学籍管理系统
随机推荐
Teacher Wu Enda's machine learning course notes 04 multiple linear regression
2D cartoon rendering - advanced skills
CVPR2021| 基于自监督学习的多视图立体匹配 (CVPR2021)
330. 按要求补齐数组
gin 模版
做开发4年13K,想转行自动化测试,薪资还能涨吗···
Salesforce中过滤器Filter使用的相对日期
Simulation volume leetcode [normal] 222. number of nodes of complete binary tree
【C语言刷LeetCode】1054. 距离相等的条形码(M)
Vmware16 create virtual machine: cannot create a new virtual machine, do not have permission to perform this operation
[CF1054H] Epic Convolution——数论,卷积,任意模数NTT
MySQL queries are case sensitive
[solution] error: lib/bridge_ generated. dart:837:9: Error: The parameter ‘ptr‘ of the method ‘FlutterRustB
Leetcode-592: fraction addition and subtraction
resize2fs: 超级块中的幻数有错(Bad magic number in super-block )
Thread synchronization - producers and consumers, tortoise and rabbit race, dual thread printing
LeetCode 879. 盈利计划
Excel文件读写(创建与解析)
[C language brush leetcode] 2332. The latest time to get on the bus (m)
【C语言刷LeetCode】67. 二进制求和(E)