当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
11种你需要了解的物联网(IoT)协议
UE4 创建暂停和结束游戏UI
ELK日志分析系统
物联网通信协议全解析
合作的小伙伴,缺乏主人翁(owner)意识,好苦恼
系统层面知识连接收藏
Mysql子查询关键字的使用(exists)
【HCIE】NO.45 Hub and Spoke配置案例
MySQL multi-table association one-to-many query to get the latest data
【无标题】
MYSQL unique constraint
MySQL 8.0.29 解压版安装教程(亲测有效)
navicat连接MySQL报错:1045 - Access denied for user ‘root‘@‘localhost‘ (using password YES)
How to quickly delete the compressed package password?
Matlab论文插图绘制模板第41期—气泡图(bubblechart)
MySQL 8.0.29 decompressed version installation tutorial (valid for personal testing)
RADIUS 如何提高 WiFi 无线网络安全性?
数学建模学习笔记:层次分析法(AHP)
CubeSat Light-1
Navicat报错:1045-Access denied for user [email protected](using passwordYES)








