In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you what to do if navicat cannot connect to the database. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
When navicat connects to the database, it sometimes fails to connect. In the west, I would like to sum up the reasons and solutions.
As we all know, using Navicat to connect to a database is usually connected like this:
Problem sorting and solutions
Error one:
Cause of error:
The local IP (xxx.xxx.xxx.xxx) does not have permission to access the remote database. So the local IP (xxx.xxx.xxx.xxx) access to the remote mysql database is enabled below.
Solution:
1. First, connect remotely to the server, enter mysql-u root-p in cmd, then enter the password and enter to enter the mysql command line.
2. Enter use mysql
3. Enter select user,password,host from user; to see that there are only localhost hosts in host. We need to add xxx.xxx.xxx.xxx here as well.
4. The method of adding is as follows:
Input
Grant all privileges on *. * to root@ "xxx.xxx.xxx.xxx" identified by "password"; (xxx.xxx.xxx.xxx can also use% for all IP)
Or
GRANT ALL PRIVILEGES ON *. * TO 'root'@'xxx.xxx.xxx.xxx' IDENTIFIED BY' 123456 'WITH GRANT OPTION
This is equivalent to giving IP-xxx.xxx.xxx.xxx all permissions, including remote access.
And then enter
Flush privileges
This is equivalent to reloading mysql permissions, which must be done.
5. Enter select user,password,host from user again
You can see that there is already a new IP in host.
6. Now you can access the remote mysql database with Navicat for MySQl again, and you can open it normally.
Problem solved.
7. If you still can't connect, is MySQL Server bound to the local address, open / etc/mysql/my.cnf
Found: bind-address = 127.0.0.1
Remove the IP address binding and change it to: bind-address = 0.0.0.0
Then restart MySQL Server:/etc/init.d/mysql restart
Error 2:
ERROR 2003 (HY000): Can't connect to MySQL server on 'hostxxxxx' (10061)
Cause of error:
The mysqld database service was not started.
Solution:
Check: in the task manager of windows, or under unix/linux, ps-aux | grep mysql to take a look. Confirm that the service has been started.
Processing: starting the mysqld service
Error 3:
Firewall is on.
Solution:
The firewall needs to allow port 3306 connections.
[note: perform the above steps under the virtual machine (LINUX). The IP address xxx.xxx.xxx.xxx is the IP address to write windows or% is OK]
Thank you for reading! This is the end of the article on "what to do if navicat cannot connect to the database". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.