当前位置:网站首页>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
边栏推荐
猜你喜欢
去字节跳动自动化测试二面原题(根据录音整理)真实有效 26
Android Studio 实现登录注册-源代码 (连接MySql数据库)
MySQL multi-table association one-to-many query to get the latest data
数学建模笔记:TOPSIS方法(优劣解距离法)和熵权法修正
apisix-入门使用篇
系统(层次)聚类
【MLT】MLT多媒体框架生产消费架构解析(一)
Detailed explanation of AMQP protocol
go语言中的goroutine(协程)
"Digital reconstruction of the system, getting the CEO is the first step"
随机推荐
AMQP协议详解
转:张五常:比知识更重要的,是思维方式
[Digital IC hand-tear code] Verilog fixed priority arbiter | topic | principle | design | simulation
navicat连接MySQL报错:1045 - Access denied for user ‘root‘@‘localhost‘ (using password YES)
2022年100道最新软件测试面试题,常见面试题及答案汇总
行测不会概念
canvas 像素操作(图片像素操作)
MySQL 8.0.29 解压版安装教程(亲测有效)
Google 安装印象笔记剪藏插件
【热题】LeetCode 热题 HOT 100分类+题解
UE4 事件图表不小心拉了很远,找不到一开始创建的节点
利用浏览器本地存储 实现记住用户名的功能
数学建模学习笔记:层次分析法(AHP)
公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范
MySQL大批量造数据
从DES走到AES(现代密码的传奇之路)
Mysql实现乐观锁
物联网通信协议全解析
[QNX Hypervisor 2.2用户手册]9.20 vdev
ELK日志分析系统