To tunnel a connection using SSH:
Select
mysql
from the Database Type list. Provide a caption and a description to identify the connection.In the Basic tab, enable Connect SSH Tunnel. This action opens the SSH Tunnel tab.
-
In the SSH Tunnel tab, do the following:
-
Specify a valid URI in the SSH URI field. Your URI consists of your SSH user name, the SSH host name, and the port number on which the host listens. For example:
admin@ssh-host5:22
Locate the SSH Private Key File field and then navigate to where the
id_rsa
file is stored on your system.If needed, specify an alternative path in Custom Path for the SSH Configuration File.
Click
.
-
If a remote host is missing from the system's list of known hosts, a prompt requires you to confirm the host's fingerprint before storing it. If your stored host fingerprint is different than the host's current fingerprint, then an error is generated and you are required to handle the discrepancy from outside of MySQL Shell for VS Code before creating the connection.
On Linux and macOS, SSH host fingerprints are stored in
~/.ssh/known_hosts
. On Microsoft Windows,
they are stored in a file under the user's folder, such as
C:\Users\username\.ssh\known_hosts
.