当前位置:网站首页>When Navicat connects to MySQL, it pops up: 1045: Access denied for user 'root'@'localhost'
When Navicat connects to MySQL, it pops up: 1045: Access denied for user 'root'@'localhost'
2022-07-30 21:41:00 【Timely movement】
Error reason: When the Error 1045 error occurs when logging in to the MySQL database, it means that the user name or password you entered is incorrect and the access is denied. It may also be that your account is not allowed to log in remotely, and you can only log in to the database locally on localhost.
The solution is as follows:
- Open cmd with administrator privileges, and cd into the bin file of the mysql installation directory.



2. Start mysql and enter mysql
The first step: start the mysql service, which can be achieved through the "net start mysql" command;
Step 2: Enter on the command line: mysql -u username -p password; press Enter; -h means server name, localhost means local, -hlocalhost can be omitted; -u is database username, root is mysql defaultUser name; -p is the password. If a password is set, you can directly enter it after the -p link, such as: -p123456, the user has not set a password. When Enter password is displayed, just press Enter.)
mysql -u root -p
3.
GRANT ALL PRIVILEGES ON . TO “root”@”%” IDENTIFIED BY 'database password' WITH GRANT OPTION; # Modify authorization to give any host permission to access the database
GRANT ALLPRIVILEGES ON . TO “root”@”%” IDENTIFIED BY '123456' WITH GRANT OPTION
mysql> FLUSH PRIVILEGES; # Refresh permissions, authorized modifications take effect
mysql> exit; # Exit MySQL server
When connecting with Navicat again, enter the password modified above for the password

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
边栏推荐
猜你喜欢

navicat无法连接mysql超详细处理方法

DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images

TransGAN代码复现—九天毕昇平台

MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql

【信息安全技术】RSA算法的研究及不同优化策略的比较

It is enough for MySQL to have this article (disgusting typing 37k words, just for Bojun!!!)

HCIP第十六天

Detailed explanation of the delete problem of ClickHouse delete data

NEOVIM下载安装与配置

nVisual网络可视化管理平台功能和价值点
随机推荐
导航栏----个人中心 Dropdown
socket:内核初始化及创建流(文件)详细过程
go慢速入门——函数
MySQL压缩包方式安装,傻瓜式教学
数据指标口径不统一、重复开发?亿信ABI指标管理平台帮你解决
kubernetes
Image Restoration by Estimating Frequency Distribution of Local Patches
史上超强最常用SQL语句大全
【网络安全专栏目录】--企鹅专栏导航
手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践
MySQL 8.0.29 set and modify the default password
IDEA 连接 数据库
About the error of SFML Rect.inl file
MySQL user authorization
JDBC(详解)
你需要知道的ES6—ES13开发技巧
系统结构考点之流水线向量点积
类和对象——上
(7/29) Basic board minimum spanning tree prim+kruskal
【零代码工具】15 款企业级零代码开发平台推荐,总有一款是你心仪的