当前位置:网站首页>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
边栏推荐
- ClickHouse to create a database to create a table view dictionary SQL
- 1064 Complete Binary Search Tree
- 类似 MS Project 的项目管理工具有哪些
- [Deep Learning] Target Detection | SSD Principle and Implementation
- MySQL 5.7详细下载安装配置教程
- Image Restoration by Estimating Frequency Distribution of Local Patches
- navicat新建数据库
- WinDbg实践--入门篇
- MySQL Soul 16 Questions, How Many Questions Can You Last?
- LeetCode·23.合并K个升序链表·递归·迭代
猜你喜欢

cookie和session区别

基于ABP实现DDD--领域逻辑和应用逻辑

MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat

新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行

Advanced c language: pointers (5)

走进Redis,让你重新认识redis。绝不是表面
![[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery](/img/12/f9fe60c7fc3d376aa95a4756541b61.png)
[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery

MySQL 5.7 detailed download, installation and configuration tutorial

面试难题:分布式 Session 实现难点,这篇就够!

It is enough for MySQL to have this article (disgusting typing 37k words, just for Bojun!!!)
随机推荐
基于ABP实现DDD--仓储实践
The most powerful and most commonly used SQL statements in history
牛客网——业务分析-提取值
openim支持十万超级大群
基于ABP实现DDD--实体创建和更新
A simple rich text editor
navicat新建数据库
Teach you how to build a permanently running personal server
NEOVIM下载安装与配置
活动推荐 | 2022年深圳最值得参加的边缘计算活动
Deep Non-Local Kalman Network for VideoCompression Artifact Reduction
JS中获取元素属性的8大方法
ClickHouse删除数据之delete问题详解
Google Earth Engine ——我们如何筛选一个列表中的排序以时间为例
QUALITY-GATED CONVOLUTIONAL LSTM FOR ENHANCING COMPRESSED VIDEO
MySQL user authorization
y82.第四章 Prometheus大厂监控体系及实战 -- 监控扩展和prometheus 联邦(十三)
[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery
你需要知道的ES6—ES13开发技巧
Google Earth Engine ——ee.List.sequence函数的使用