Está en la página 1de 3

Connecting to a server

Basics
HeidiSQL is a so called client application, only usable when you have some server
available. So, make sure you have some MySQL, MS SQL or PostgreSQL server to
connect to.

A simple setup is to have a MySQL server installed on localhost (equivalent to the


special IP address 127.0.0.1). In HeidiSQL's session manager, you click on the "New"
button to create a new connection, and most default settings are already set for you,
except from the password, which is mostly not an empty one on a newly installed
MySQL server:
You can organize your stored sessions in folders. To create a folder, click the dropdown
arrow on the "New" button, then click "Folder in root folder" or "Folder in selected
folder". Once you have a folder, you can create connections in it, or drag existing
connections into that folder.

Setting up a SSH tunnel connection to MySQL


If your MySQL server is located on a remote machine which is only accessible via SSH,
then you still can use HeidiSQL to connect to it. You just need the additional plink.exe
from the PuTTY project, place it somewhere on your harddisk, and finally tell
HeidiSQL where it is and the SSH credentials plus the MySQL credentials.

Note that the default host name for the SSH server is the one you entered in the
"Settings" tab. HeidiSQL then advices plink.exe to connect to that host name, or, when
you entered a SSH host name, that one is taken. Additionally, the host name on the
"Settings" tab is always taken for the -L (listen) option in plink.exe.

Example settings:

"Settings" tab:
o Hostname: "127.0.0.1"
o Password: [your mysql password]
o Port: "3306" in most cases
"SSH tunnel tab:
o SSH Host: [your server name]
o Port: "22" in most cases
o Username: [your ssh user]
o Password: [your ssh password]
o Local port: "3307"

The following error, or a similar one, is mostly caused by a tunnel onto the official IP
address of your remote server:
Lost connection to MySQL server at 'reading initial communication packet', system
error: 0 "Internal error/check (Not system error)"

In such cases, ensure you're using "127.0.0.1" in Settings > Hostname/IP, and the
remote IP of your server in SSH tunnel > Host.

También podría gustarte