当前位置:网站首页>Navicat报错:1045 -拒绝访问用户[email protected](使用passwordYES)
Navicat报错:1045 -拒绝访问用户[email protected](使用passwordYES)
2022-08-02 06:10:00 【Mmm okay!】
Foreword:
The thing is like this, yesterday I was debugging an oython project given by my mentor. This project has no documentation, so I need to match and create the database information myself, so I connected this project to my local database., to debug. After I connected to the database, I ran the Flask project, but the database could no longer be opened, and an error was displayed:
1045-Access denied for user [email protected](using password:YES).In order to let friends who encounter the same problem avoid this pit, I will record the process of solving it.
Body:
Anyone who encounters this problem on the terminal has a high probability of forgetting the password, but when Navicat cannot open the database, there is a high probability that something went wrong, and I don't know the details, so I solved it like this:
First open the terminal as administrator, then open the database:

Then enter the command: mysql -u root -p

Type your password again.Then enter a command to change your current password:
Ps: This place must be tried!!!At first, I didn’t believe that changing the password would be enough. I felt that this problem should be solved from the root cause, but it turns out that changing the password is really effective. I can log in with Navicat after changing the password.
The command to change the password in versions before mysql8.0:
update mysql.user set authentication_string=password("new password") where user="root";The command to change the password in versions after mysql8.0:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password'
How to see what version of mysql is, you can check it from Navicat:

Of course, if the command according to the corresponding version does not work, try another command.
After entering the command, exit mysql and log in with the new password once:

If it doesn't work, you need to look at other bloggers' articles, because this error is really sudden, and the solution is also very sudden...
Summary:
When encountering this kind of problem, you can start with the simplest way to change the password. If changing the database password can't solve it, go to find a further method, at least one possibility is ruled out.If you have a better solution, please comment below or send me a private message, thank you very much!???
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢

大屏UI设计-看这一篇就够了

认识CAN光纤转换器的光纤接口和配套光纤线缆

navicat连接MySQL报错:1045 - Access denied for user ‘root‘@‘localhost‘ (using password YES)

公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范

MySQL安装教程

来自雪域高原的馈赠——大凉山高原生态糖心苹果

12 reasons for MySQL slow query

MySQL 8.0.28 version installation and configuration method graphic tutorial

MySQL 8.0.29 decompressed version installation tutorial (valid for personal testing)

元宇宙:活在未来
随机推荐
Navicat如何连接MySQL
Mysql常用命令大全
CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换
MySql将一张表的数据copy到另一张表中
【无标题】
MES如何做好生产过程监控,本文给出了详细解答
ZCMU--1891: kotomi and game(C语言)
canvas 像素操作(图片像素操作)
【疑问】最终推荐的loose pattern 如果依赖module 没有加载完毕,行为如何,是否报错
MySQL导入sql文件的三种方法
【HCIE】NO.30 OSPFv3的基本配置
Redis常见题型
Google Chrome(谷歌浏览器)安装使用
MySQL大批量造数据
07-传统的生产者消费者问题、防止虚假唤醒
golang环境详细安装、配置
MySQL 8.0.29 解压版安装教程(亲测有效)
LeetCode刷题系列 -- 787. K 站中转内最便宜的航班
UE4 局域网联机案例
Go语学习笔记 - grpc serverclient protobuf 从零开始Go语言