当前位置:网站首页>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
边栏推荐
猜你喜欢
Niu Ke Xiaobaiyue Race 53 A-E
深入浅出富文本编辑器
navicat新建数据库
kubernetes
cmd (command line) to operate or connect to the mysql database, and to create databases and tables
The most complete Redis basic + advanced project combat summary notes in history
The Road to Ad Monetization for Uni-app Mini Program Apps: Rewarded Video Ads
Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
使用LVS和Keepalived搭建高可用负载均衡服务器集群
Day 16 of HCIP
随机推荐
大家都在用的plm项目管理软件有哪些
socket: Kernel initialization and detailed process of creating streams (files)
基于ABP实现DDD--领域逻辑和应用逻辑
MySQL 8.0.29 设置和修改默认密码
mysql 时间字段默认设置为当前时间
Typescript 严格模式有多严格?
How do I refresh the company's background management system (Part 1) - performance optimization
登堂入室之soc开发makefile
qt使用动态库(DLL)
MySQL 用户授权
ClickHouse 创建数据库建表视图字典 SQL
TransGAN代码复现—九天毕昇平台
MySQL 灵魂 16 问,你能撑到第几问?
基于ABP实现DDD--仓储实践
kubernetes
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery
Installation and use of cnpm
微信公众号授权登录后报redirect_uri参数错误的问题
CISP-PTE真题演示