What should I do if Navicat cannot connect to MySQL directly?

Background of this article

Navicat is a powerful tool for graphically operating MySQL, but when the database server does not open port 3306 to the office network, it is not possible to connect to the database using Navicat on the office network. To operate the database, you can only log in to the database server with SSH, and then press the command on the black screen to operate the database. It is very unfriendly. There will be some problems such as unclear line breaks and garbled characters.

Use SSH to jump

Here is a solution, the server will open the ssh port to the office network, Navicat can connect to the database by configuring the ssh channel. The essence is to jump through SSH, the configuration is as follows

Configure SSH tab

Open Navicat, click File -> New Connection -> Click the SSH tab, check Use SSH channel, fill in the IP, username, and password of the SSH connection, and click OK. Note that this is all SSH address and user name, not database.
What should I do if Navicat cannot connect to MySQL directly?

Configure General Tab

Then click the General tab, write localhost in the address and the user name of the database in the user name. The password is the password of the database user, click OK. Double-click the database connection name on the left to connect to the database.
What should I do if Navicat cannot connect to MySQL directly?

in conclusion

According to the configuration in this article, the operation of the database is the same as that of directly connecting to the database through port 3306, and the ease of operation is incomparable to the black screen of ssh.

Guess you like

Origin blog.51cto.com/14947900/2547802