Basic help on using HeidiSQL
This document aims to give users some basic help to get started with HeidiSQL. Over the years, the feature list has grown longer and longer. So, especially new users sometimes don’t know where to look at for particular things. In such cases, you can watch out here for a first help. If you don’t find what you’re looking for, please register in the forum and post a question.
Requirements
HeidiSQL runs fine on Windows 8 and 10 (and on Windows 7 with some minor issues). Running HeidiSQL on Wine is currently quite unstable.
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 MariaDB, MySQL, MS SQL, PostgreSQL server or SQLite database file to connect to.

A simple setup is to have a MariaDB 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 MariaDB 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 MariaDB/MySQL/PostgreSQL
If your MariaDB/MySQL/PostgreSQL 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 MariaDB/MySQL/PostgreSQL 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.

- «Settings» tab:
- Hostname: «127.0.0.1»
- Password: [your mysql password]
- Port: «3306» in most cases
- SSH Host: [your server name]
- Port: «22» in most cases
- Username: [your ssh user]
- Password: [your ssh password]
- 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:
Command line switches
Although HeidiSQL is a pure GUI application, it can be automated for connecting and opening files via command line parameters. Parameter names are case sensitive and are based on those used by the MariaDB/MySQL command line applications, e.g. mysqldump.
- Be sure to call HeidiSQL with its full file name («heidisql.exe»), not with the short version («heidisql»). HeidiSQL’s command line parser expects that this way. This should be fixed in the future.
- Parameter keys can be separated with = or one space from their value, e.g. -h=localhost
- Parameters containing a dot must be wrapped in double quotes. This is important when passing an IP address: -h=192.168.1.1 will use only the first segment 192, while -h=»192.168.1.1″ is the correct form.
- 0 = MariaDB/MySQL (TCP/IP)
- 1 = MariaDB/MySQL (named pipe)
- 2 = MariaDB/MySQL (SSH tunnel)
- 3 = MSSQL (named pipe)
- 4 = MSSQL (TCP/IP)
- 5 = MSSQL (SPX/IPX)
- 6 = MSSQL (Banyan VINES)
- 7 = MSSQL (Windows RPC)
- 8 = PostgreSQL (TCP/IP)
- 9 = PostgreSQL (SSH tunnel)
- 10 = SQLite
- 11 = ProxySQL Admin
- 12 = Interbase (TCP/IP)
- 13 = Interbase (local)
- 14 = Firebird (TCP/IP)
- 15 = Firebird (local)
- MySQL/MariaDB:
- libmariadb.dll
- libmysql.dll
- libmysql-6.1.dll
- . any fitting dll from your HeidiSQL directory
- MSOLEDBSQL
- SQLOLEDB
- libpq.dll
- libpq-12.dll
- . any fitting dll from your HeidiSQL directory
- sqlite3.dll
- . any fitting dll from your HeidiSQL directory
- ibclient64-14.1.dll
- gds32-14.1.dll
- . any fitting dll from your HeidiSQL directory
- fbclient-4.0.dll
- . any fitting dll from your HeidiSQL directory
- MySQL/MariaDB: 3306
- MS SQL: 0 (auto-detection by driver, previously 1433)
- PostgreSQL: 5432
- SQLite: no value
- Interbase/Firebird: 3050
Examples:
- Start over using stored settings from session «xyz»:
- c:\path\to\heidisql.exe -d=xyz
- c:\path\to\heidisql.exe -description=xyz
- c:\path\to\heidisql.exe -d=xyz -u=OtherUser
- c:\path\to\heidisql.exe -d=xyz -P=3307
- c:\path\to\heidisql.exe -h=»127.0.0.1″ -u=root -p=Mypass -P=3307
- c:\path\to\heidisql.exe fileA.sql path\to\fileB.sql fileC.sql .
- c:\path\to\heidisql.exe —psettings=c:\temp\p.txt
The database tree
When you have a large amount of tables, views or whatever in your database(s), you probably want to group these by their type, for a better overview. Just right click the tree and activate Tree style options > Group objects by type:

You can also mark important items as so called favorites, by mouse click on the very left area of a table. Afterwards, you can limit the tree to show only favorites by a click on the new «Show only favorites» button at the top:

Creating a table
HeidiSQL comes with a feature-rich GUI for creating and editing a table structure. Just right click the datatabase in which you want to create a table, then point on «Create new», then click «Table»:

Done that, you’ll see the table editor like in the following picture:

Creating a view
Click «Create new», then click «View», to show up the view editor. Creating a view is basically like writing a SELECT query. Give it a name, and click the save button to create it. HeidiSQL shows the data of the view in the «Data» tab, like for tables.
One thing you might notice is that MySQL and MariaDB are reformatting the SELECT query in the view when you save it. This destroys indentation, and converts the whole query into a one-liner. HeidiSQL tries its best to restore the original code of the view, by loading it from the *.frm file on the server. However, this fails in many cases, often due to restricted file privileges. For such cases, the only way to make it readable again is to use HeidiSQL’s reformatter (Ctrl+F8).

Creating a stored procedure
Just right click the datatabase in which you want to create a procedure, then point on «Create new», then click «Procedure» or «Function». Done that, you’ll see the procedure editor like in the following picture:

Creating a trigger

Creating a scheduled event

The Data tab
On the data tab, the contents of the currently selected table or view are displayed. This is one of the most useful and powerful features of HeidiSQL. You will see different colors for the various groups of data types. These colors are customizable in Tools > Preferences > Data appearance.
Pressing F2 or one-long-click in a grid cell will start the editor mode. This will allow you inserting ordinary values into a row. For inserting special values, such as SQL functions, NULL or GUIDs, right click a cell, and point to the Insert value > submenu.
Quick filters: Right click a value in the grid, then click Quick filter to get various one-click options to create a WHERE clause on the grid values. This filter can be base on either the focused cell in the grid, a prompted value, or on the contents of your clipboard.
In the Quick filter sub menu, you will find a More values sub-sub-menu. Pointing to that menu, HeidiSQL quickly collects and displays the top 30 items in the focused column, grouped by their value:

Finding specific values in such a grid can be a pain. For a simple client side filter, you can enter some value in the filter panel. Activate it in Edit > Filter panel (Ctrl+Alt+F):

HeidiSQL can also assists you with a Search and replace dialog (Find mode: Ctrl+F, Replace mode: Ctrl+R). That dialog can be used on SQL query tabs too.

Binary values, also called BLOBs, are by default displayed in hexadecimal format, which is mostly unreadable for a human being. For cases in which such BLOBs contain readable text, HeidiSQL offers to toggle between hex-mode and text-mode. Press or «unpress» the white button with the purple «0x» on it:

Probably you have a table with one or more integer columns which represent UNIX timestamps. HeidiSQL can display such integer columns as date/time values, so you can better read them:

Running SQL queries
HeidiSQL has a «Query» tab by default. You can create more than this default one by pressing Ctrl+T, or by right clicking the main tabs, then click «New query tab». In such a query tab, you can write your own database queries, or load a .sql file from your harddisk. Pressing F9, or the button with the blue «play» icon on it executes your query or queries.
Compound queries e.g. for creating a function often have a semicolon inside the query. As HeidiSQL separates queries at each semicolon, you will get syntax errors when you run such commands. You can set a different query delimiter for such purposes, e.g. «!!», as shown in the screenshot:

Alternatively, you can change the delimiter via code:
DELIMITER !!
— your code
DELIMITER ;On the right hand of each query tab, you have the «query helpers» panel, with table columns, reserved words, SQL functions etc.
Having a table selected in the left tree, the first tree item in the helpers show «Columns in <selected-table>». The contained «Generate. » menu items use the selected column names to create a quick query for you in the editor:
To see how your query performs in MariaDB or MySQL, you can activate the «Query profile» option in the helpers box on the right. Then, run your query or queries, and see what the profile timings show. This is basically what SHOW PROFILE in MySQL 5.0.37 and later releases does.

HeidiSQL supports parameterized SQL queries: Activate it per click on the checkbox «Bind parameter», and start writing a query with parameters, e.g. select ‘:p’ .

The first part of the bind parameter implementation was done by Adrian Granger.
HeidiSQL can execute a batch of queries (= multiple queries, separated by semicolon) in one go. That way, execution gets dramatically faster, especially when having tons of mini queries. To activate that «one go execution», just click the drop down menu of the blue «play» button, then click «Send batch in one go»:

MS SQL users should turn this on when having trouble with declaring a variable, e.g.:
Declare @RowNo int =1;
SELECT @RowNo;SQL export
HeidiSQL can generate nice SQL export files for you. This is basically what mysqldump also does. However, you can also tell HeidiSQL to put the results of the export into
- an .sql file
- a ZIP compressed .sql file
- into your clipboard
- another database on the same server
- a new or existing database on a server on which you have a configured HeidiSQL session
Importing files
HeidiSQL can import .sql files with data rows and/or structure, .csv files with data rows and binary files for BLOBs.
Importing .sql files
At first, activate the database you want the import to run in. Then, go to File > «Run SQL file», and select the file to import. Below the filename input box, you will find an Encoding dropdown menu. Using «Auto detect» is a common way to get broken data afterwards — so if are sure about the encoding in that file, you should definitely select the right one, e.g. «UTF-8». After clicking «OK», HeidiSQL will start to execute the contained commands immediately, and you can watch the progress:

Importing .csv files (text files)
A .csv file is a text file with data rows for one table. You can import such a file into a table via Tools > «Import CSV file». You will have to tell HeidiSQL the format of the file (line terminator, enclosing character etc.).

Importing binary or text files into BLOBs
Via Tools > «Insert files into TEXT/BLOB fields», you can insert new rows from all kind of files into your tables. First, select the database and the table you want to put the files into. Then, click on the green «Add» button, to add one or more files to the listing. In the upper listing you will have to tell HeidiSQL with placeholders in which column the file content goes. In the «Value» column, click besides the right field name and select ‘%filecontent%’ . Some other placeholders are available in that dropdown. You can also wrap the placeholders (or even static text) with some SQL function. For example if you want the file name in lowercase, you apply LOWER(‘%filename%’) .

HeidiSQL portable
If HeidiSQL finds a portable.lock file, or a portable_settings.txt , or the custom filename as noted above, it starts in portable mode. Which means basically that all settings are restored from that file and when exiting stored again into that file.
When you download the portable package, that portable_settings.txt needs to be manually copied from your old portable HeidiSQL directory. Not doing so will show you an empty session manager.
License
HeidiSQL is OpenSource and released under GPL (GNU GENERAL PUBLIC LICENSE). See the license.txt for more details.
Probably HeidiSQL saved you a lot of time and you like it. In this case you may make a donation here.
popstas / heidisql.md
#Добавление сервера Делается через ssh туннель По вкладкам:
- Тип сети: MySQL (SSH tunnel)
- Имя хоста: localhost
- Пользователь: юзер_mysql
- Пароль: пароль_mysql
- Порт: 3306
- Базы данных, Комментарий: пустые
- галочки все убраны
- Путь до plink.exe: качаем plink.exe (из комплекта putty)
- SSH хост+порт: IP или домен сервера, порт 22
- Пользователь: любой SSH юзер с доступом к шеллу, root здесь не нужен
- Пароль: пустой
- Тайм-аут подключения: 1
- Файл закрытого ключа: путь_до_ppk
- Локальный порт: любой незанятый порт. Здесь самое непонятное: нужно указать свободный на локальной машине порт. То есть, если у 2 серверов указать, например, порт 3307, то одновременно подключиться можно будет только к одному из них. Лучше указывать последовательно для каждого сервера: 3307, 3308, 3309, и т.д.
Остальные вкладки оставляем пустыми, подключаемся.
Список баз и таблиц в боковой панели:
- поиск по базе/таблице, результаты откроются в разных вкладках, по вкладке на таблицу
- обслуживание (можно проверять и чинить таблицы)
Вкладка «Хост» (только для mysql root)
Список баз, просмотр переменных, текущих запросов (можно массово убивать)
База знаний
В данной статье мы рассмотрим подключение к СУБД MySQL при помощи программы HeidiSQL по SSH туннелю.
Убедимся, что pagent запущен и ключ активен. Запускаем HeidiSQL.

Выбираем сеанс по умолчанию Unnamed или создаим новым и приступим к настройке.
Во вкладке Настройки выбираем Тип сети MariaDB or MySQL (SSH tunnel)

Далее переходим в появившеюся вкладку SSH туннель и заполняем данные от сервера полученные в письме.

Если поле Расположение plink.exe окажется пустым — укажите путь в ручную, данная программа находится к каталоге установки PuTTy (обычно C:\Program Files (x86)\PuTTy\plink.exe как указано на картинке). Остальные поля заполняйте как в примере. Путь к файлу закрытого ключа указывать не обязательно (может не работать на старых версиях HeidiSQL). Настройка SSH туннеля окончена.
Следюущим шагом переходим на вкладку Настройки и заполняем данные подключения к MySQL серверу.

Вводим данные по примеру из картинки, жмем Сохранить и пробуем открыть сеанс (подключиться к серверу).
Если все сделано верно, то следующим окном мы увидим список баз данных.

На этом пока все. Для более продвинутого использования HeidiSQL ознакомтесь с инструкциями на официальном сайте
- mysql, phpmyadmin, heidisql, navicat, how to connect
- 5 Пользователи нашли это полезным
Связанные статьи
Личный RSA ключ необходим для получения полного доступа к заказанынм услугам и сервисам Games.
В прошлой статье мы рассмотрели как создавать RSA ключ для доступа к серверу. В данной статье мы.
Подключение MySQL с помощью клиента HeidiSQL
Для подключения к базам данных MySQL ранее чаще всего использовалось веб-приложение с открытым кодом phpMyAdmin, которое представляет собой веб-интерфейс для администрирования СУБД MySQL. Программа позволяла через браузер администрировать сервер MySQL, выполнять команды SQL и просмотр содержимого таблиц и баз данных.
На сегодняшний день разработаны бесплатные и интуитивно понятные альтернативные программы для подключения к базам данных MySQL, среди которых можно назвать HeidiSQL и Navicat.
Рассмотрим подключение к MySQL с помощью бесплатного клиента HeidiSQL.
Данная утилита позволяет существенно упростить и ускорить процесс работы с базами данных SQL, с легкостью создавать новые базы, управлять пользователями, заполнять базы данных таблицами.
В большинстве случаев с помощью программы HeidiSQL невозможно соединение с удаленной базой данных хостинг-провайдера, поэтому ее используют в локальной среде разработки. Т.е. приложение HeidiSQL позволяет работать с базами данных SQL на локальном компьютере.
Данные для подключения
Для подключения необходимо знать Адрес и Порт для подключения, а также нужны Имя пользователя и Пароль. Эти данные можно найти в разделе Пользователи FTP $\to$ База данных.
Установка и настройка HeidiSQL
Бесплатную версию программы HeidiSQL для управления базами данных MySQL, которая позволяет подключаться к серверу MySQL и выполнять разные операции администрирования СУБД, можно скачать на официальном сайте программы.
Установка HeidiSQL ничем не отличается от стандартной установки программного обеспечения.
После запуска установочного файла необходимо согласиться с лицензионными условиями и нажать кнопку Next.
На следующих этапах установки также необходимо нажимать кнопку Next до полной установки программы.
После установки нужно запустить программу HeidiSQL, после чего на экране появится предложение импортировать настройки. Эта опция программы необходима в случае, когда нужно будет переустановить операционную систему Windows.
При первой установке программы нужно нажать кнопку Создать, чтобы добавить новый сеанс.
Появится окно настроек сеанса, в котором нужно ввести:
- адрес сервера, в качестве которого указывается имя или IP-адрес компьютера, на котором запущена служба MySQL;
- логин и пароль для подключения к серверу MySQL.
В случае, когда подключаются с другого компьютера сети, нужно открыть порт 3306 на хосте, на котором установлен MySQL.
Чтобы авторизоваться на сервере используется учетная запись администратора root и пароль администратора root, которой, который раньше был задан при установке MySQL.
После ввода всех необходимых данных нужно нажать кнопку Открыть для выполнения подключения к службе MySQL.
Создание новой базы данных на сервере MySQL
Для создания новой базы данных на сервере MySQL с помощью клиента HeidiSQL после подключения к серверу в окне приложения необходимо вызвать контекстное меню на текущем сеансе и выбрать пункт Создать, а после – База данных.
Поля окна, которое появится в результате, нужно заполнить. Для удобства базу данных принято называть так же, как и сайт, для которого она создается. Если такой возможности нет, можно дать любое название, которое впоследствии будет использоваться для дальнейшей настройки движка сайта.
В выпадающем списке Сопоставление нужно выбрать utf8_unicode_ci и нажать кнопку ОК.
После проделанных действий база данных, которая была создана, отобразится в списке сеанса.
На этом этапе создание новой базы данных на сервере MySQL выполнено. Теперь можно приступать к установке и настройке CMS нового сайта.