当前位置:网站首页>Navicat报错:1045-Access denied for user [email protected](using passwordYES)
Navicat报错:1045-Access denied for user [email protected](using passwordYES)
2022-07-30 00:19:00 【m0_67393157】
前言:
事情是这样的,昨天我在调试导师给的一个oython的项目,这个项目是没有文档的,所以数据库那些信息我需要自己去匹配去创建,于是我将这个项目连接到了我本地的数据库,来进行调试,在我连接上数据库后,运行了这个Flask项目,结果数据库就再也打不开了,显示报错:
1045-Access denied for user [email protected](using password:YES)。为了让遇到同样问题的朋友们避开这个坑,我将解决的过程记录下来。
正文:
在终端上面遇到这个问题的小伙伴大概率都是忘记了密码,但是遇到Navicat打不开数据库的,大概率是发生了什么错误,细节我也不清楚,我是这么解决的:
首先以管理员的身份打开终端,然后打开数据库:

然后输入指令:mysql -u root -p

再键入你的密码。然后是输入一行修改你目前密码的命令:
Ps:这个地方一定要尝试!!!刚开始我也不相信修改了密码后就可以了,觉得这个问题应该要从根源上解决,但是事实证明改密码真的有效,我就是改完密码后又可以用Navicat登陆进去的。
mysql8.0前的版本修改密码的命令:
update mysql.user set authentication_string=password(“新密码”) where user=“root”;mysql8.0以后的版本修改密码的命令:
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘新密码’
如何看自己的mysql是什么版本的呢,可以从Navicat上看:

当然如果按照相应版本的指令无效的话,也试一下另一条指令。
在输入指令后,退出mysql,然后用新密码登录一次就可以了:

如果不行的话,需要再看看其他博主的文章,因为这个报错,真的是很突然,解决的也很突然。。。
总结:
在遇到这类问题,可以先从最简单的修改密码开始尝试,如果修改数据库密码都解决不了的话,再去寻找进一步的方法,至少排除了一种可能。如果大家有更好的解决方法,还请大家在下方评论或者私信给我,感激不尽!???
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- The basic parallel I/O port of single chip microcomputer development
- Reading notes. This is the psychology: see through the essence of the pseudo psychology (version 10)"
- Finding a 2D Array
- Replace the executable file glibc version of the one
- Google Chrome (google) is set to translate Chinese, the translation option does not take effect or the translation option does not pop up
- The strongest JVM in the whole network is coming!(Extreme Collector's Edition)
- Getting Started with Sentinel
- 定时器学习
- [Training DAY16] ALFA [convex hull] [computational geometry]
- WeChat developer tools set the tab size to 2
猜你喜欢

7.27

抖音短视频流量获取攻略,掌握好这些一定可以出爆款
Docker install MySQL8.0

Google Chrome (google) is set to translate Chinese, the translation option does not take effect or the translation option does not pop up

Worthington经过使用测试的细胞分离系统方案

Toutiao We-Media Operation: How to Gain 500+ Fans in Toutiao Today?

Reading notes. This is the psychology: see through the essence of the pseudo psychology (version 10)"

Worthington弹性蛋白酶&透明质酸酶简介

How to increase account weight?3 ways to operate your own media to help you get more revenue

BEVDetNet: Bird's Eye View LiDAR Point Cloud based Real-time 3D Object Detection for Autonomous Drivi
随机推荐
Worthington解离酶:胶原酶及四个基本概况
what is a .pro file in qt
Genesis与Axis Ventures互动密切
【mysql】Mysql公用表表达式with as
Worthington经过使用测试的细胞分离系统方案
机器人的运动范围
Towhee 每周模型
每周推荐短视频:研发效能是什么?它可以实现反“内卷”?
【分层强化学习】survey
图论:二分图
He used to cells harvested trypsin & release procedure
Docker installs redis cluster (including deployment script)
Minesweeper game in c language
Worthington Dissociation Enzymes: Trypsin and Frequently Asked Questions
opencv基本图像的滤波
Since the media increase play a short video?From the three aspects
Worthington酶促细胞收获&细胞粘附和收获
Paper Intensive Reading - YOLOv3: An Incremental Improvement
Worthington's tried and tested cell isolation system protocols
窗口函数笔记