当前位置:网站首页>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
边栏推荐
- Detailed explanation of the delete problem of ClickHouse delete data
- 关于MySQL主从复制的数据同步延迟问题
- Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
- qt使用动态库(DLL)
- How do I refresh the company's background management system (Part 1) - performance optimization
- 拿什么来保护数据安全?基层数据安全体系建设待提升
- 微信公众号授权登录后报redirect_uri参数错误的问题
- MySQL 8.0.29 set and modify the default password
- IDEA 连接 数据库
- MySQL 8.0.29 解压版安装教程(亲测有效)
猜你喜欢
随机推荐
go慢速入门——函数
navicat新建数据库
史上最全的Redis基础+进阶项目实战总结笔记
The most complete Redis basic + advanced project combat summary notes in history
Difference between cookie and session
cnpm安装步骤
基于ABP实现DDD--实体创建和更新
Detailed explanation of the delete problem of ClickHouse delete data
The reason for not using bs4 is that the name is too long?Crawl lottery lottery information
关于MySQL主从复制的数据同步延迟问题
【问题】Mysql Waiting for table metadata lock 解决方案 修改lock_wait_timeout时间
【零代码工具】15 款企业级零代码开发平台推荐,总有一款是你心仪的
Google Earth Engine ——ee.List.sequence函数的使用
How strict Typescript strict mode?
1064 Complete Binary Search Tree
手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践
LeetCode·Daily Question·952. Calculate Maximum Component Size by Common Factor·Union Check
类和对象——上
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
MySQL 游标