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.
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.
Select Edit Connection.
Then click on General.
Finally, click on Test to see if it is successful. This way, we can use MySQL.
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.
-
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!
-
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."
When editing on a saved connection, the test connection is successful, but clicking on the connection will keep prompting "connection is being used."
You need to create a new connection in order to use it. You can't modify it on the saved one.