Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remotely connect to MySQL in Navicat

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to connect to MySQL remotely in Navicat? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

one

First of all, we need to change port 3306 to see if port 3306 is open to the public. MySQL is not open to external access by default. The statement is as follows:

Netstat-an | grep 3306

If the query results are as follows, we need to change the MySQL configuration file.

As you can see, port 3306 of mysql only listens for local connections, which hinders external IP access to the database and modifies the MySQL configuration file my.conf:

Vim / etc/mysql/my.cnf

find

# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.bind-address = 127.0.0.1

Comment out the line bind-address = 127.0.0.1 or change it to the client host ip you want to use.

At this point, the MySQL remote access port is successfully opened.

two

Let's go to the MySQL command interface and run the following SQL statement to see if the user has access:

Use mysql;select user, host from user

The returned result is as follows:

We use the wildcard% to modify the host field for the root user to have access to all ip addresses:

Update user set host ='% 'where user =' root'

If the following exception is thrown:

Duplicate entry'%-root' for key 'PRIMARY'

Indicates that multiple ROOT users are recorded in the USER table, and we re-execute:

Select host from user where user = 'root'

You can see the% value of the field host.

We implement:

Flush privileges

Refresh the system permissions related table of MySQL.

Finally, restart the MySQL service:

Sudo restart mysql

three

Once the server is set up, let's set up the connection on the Navicat client:

Open Navicat, click "connection" at the top left, set the database user name, address, password, etc., and you can remotely operate MySQL on the server in Navicat.

This is the answer to the question about how to connect MySQL remotely in Navicat. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report