How to install HeidiSQL on Ubuntu

Step 1: install Wine

There are three ways how you can get Wine. You can either download the stable version from the official Ubuntu repository, download it from Wine's repository, or compile the source yourself.

The simplest option is probably downloading it from the Ubuntu repository, using the command line:

sudo apt-get install wine

Follow the instructions, you will need to accept a license agreement for TrueType fonts. Use the arrow keys ( and ) and Enter to accept the terms.

Step 2: download HeidiSQL

Download the installer from http://www.heidisql.com/download.php.

Step 3: install HeidiSQL using Wine

Open the installer for HeidiSQL with Wine and follow the steps to install the application.

Step 4: add the HeidiSQL icon to the launcher (optional)

This step is optional, even without it you can start using HeidiSQL. However, I wanted to add a shortcut to the launcher, but this wasn't as easy as I thought it would be. I finally managed to do so by following these steps:

  1. First, find out where Wine is storing the HeidiSQL icon. In my instance, it was in /home/nic/.local/share/icons/hicolor/48x48/apps.
  2. You also need the location of the HeidiSQL executable. In my instance, it's in /home/nic/.wine/drive_c/Program Files/HeidiSQL.
  3. With this information, we can create a new file in ~/.local/share/applications, called heidisql.desktop.

    sudo gedit ~/.local/share/applications/heidisql.desktop
    

    (you can use another text editor instead of gedit, of course).

    Fill it with:

    [Desktop Entry]
    Name=HeidiSQL
    Comment=HeidiSQL on Ubuntu
    Exec=env WINEDEBUG=-all WINEPREFIX=/home/USER/.wine wine heidisql.exe
    Icon=/home/USER/.local/share/icons/hicolor/48x48/apps/9103_heidisql.0.png
    Path=/home/USER/.wine/drive_c/Program Files/HeidiSQL
    Terminal=false
    Type=Application
    Categories=Wine;
    StartupNotify=true
    StartupWMClass=heidisql.exe
    

    (of course you need to change the paths after Exec=, Icon= and Path= with the appropriate ones. StartupWMClass= is not compulsory but having this entry pointed to application executable filename fixes issue with unity launcher showing generic wine app icon when the app is running)

  4. Add the icon to the launcher. Either go to /home/USER/.local/share/applications using the file browser, look for the HeidiSQL icon and drag it to the launcher, or search for HeidiSQL in Dash and drag the icon from there. (as Dash might contain two identical icons for HeidiSQL, and only one is the right one, I suggest the first method)

For more information about .desktop files, see https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles.