Tangwx

Tangwx

博客网站

Connect to Raspberry Pi MySQL database using ssh in Navicat

Connecting to Raspberry Pi MySQL Database Using Navicat with SSH#

First, you need to have Navicat installed. This goes without saying.

Secondly, open Navicat and click on the Connect button. I won't include a screenshot here, but you'll be taken to a page where you can fill in the following information. You can choose any name for the connection.

Step 3: Click on the SSH Tunnel button at the top, and the following page will appear.

In the Host or IP Address field under SSH Tunnel, enter the IP address of the remote server. Pay attention, this is important: the username you enter here should be the username of the remote server, such as root, and the password should be the password of the remote server. Do not click on the Test Connection button at this step, or ignore the test connection result.

image-20230215205614137

Step 4: Go back to the General page and fill in the username and password. This is also an important point to note: at this point, the username you enter should be the username of the remote server's database, and the password should be the password of the remote server's database. Pay attention, pay attention.

Find the database that was just created with SSH.

image-20230215205712123

Select Edit Connection.

image-20230215205811878

Then click on General.

image-20230215210037581

Finally, click on Test to see if it is successful. This way, we can use MySQL.

image-20230215210129802

In summary: the important thing is to understand that the purpose of the SSH tunnel is to connect to the server, while the General settings are for connecting to the server-side database.

  1. The purpose of the SSH tunnel is to connect to the server. You need the server's username and password! The server's username and password!

  2. The General settings are for connecting to the database. You need the database's username and password, the database's username and password.

Additional note: Navicat and connection is being used.

Because I originally used the remote address and directly edited the connection in that link, every time I saved it, the test was successful. But it gave an error message saying "Navicat and connection is being used."

  1. When editing on a saved connection, the test connection is successful, but clicking on the connection will keep prompting "connection is being used."

  2. You need to create a new connection in order to use it. You can't modify it on the saved one.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.