HeidiSQL: Review and Tutorial


Share this post:

HeidiSQL: SQL in the Land of Alps and Watches

The majestic call of the Alphorn comes echoing down the mountain, filling the air with ancient mystery. A goat herder tending his modest collection of livestock patiently guides them through an alpine meadow. Children in villages festively dance around the maypole, their ribbons gradually forming a beautiful pattern. A watchmaker hunches over their workbench, patiently placing microscopic gears into place. A developer launches HeidiSQL, eager to begin querying data with their trusted SQL Client.

These goats look happy

Yes, these are the sights and sounds of Switzerland! Ancient tradition, beautiful mountain landscapes, and an oddly named, yet time-tested, SQL client. Created in 2006 by Asgar Becker (but having origins pre-dating that), HeidiSQL is a versatile open-source SQL Client. If you are looking for a portable, free SQL Client, it is worth a look.

In this post, we will embark upon a grand Swiss adventure, installing and working with HeidiSQL to achieve our loftiest SQL dreams. Along the way, we'll meet a young ambitious shepherd named Matteo, will see how he uses HeidiSQL to grow his business, and solve problems in his life.

Picture, if you will, snowy mountain peaks, a green valley, and the Heidi SQL download link. Click it. Visualize your request as a flock of Alpine Choughs lifting into flight, and your download as the churning Rhine, flowing the HeidiSQL bits onto your machine. Come to the mountains. Come to the land of HeidiSQL. Grüezi!

Heidi SQL

With the download complete, a simple setup screen collects your database information. This includes the standard connection strings, authentication, port info, as well as more technical matters (SSL, etc). Enter your connection string and credentials, and away you go!

HeidiSQL Session Manager
You connect me

HeidiSQL New Session
Everything Is So New And Pretty!

Upon logging into the selected session and database, you are greeted with a main screen, vibrant and clean as springtime in Lucerne. It contains all the standard things:

  • list of databases and tables on left
  • typical operations in menu
  • toolbar on top
  • main query window/workspace in center
  • One interesting addition - the lower output pane displays all the SQL sent to the database (for example, to compile the list of tables for the treeview on left). This could be valuable for learning about your database schema, and how to interrogate it yourself!
HeidiSQL Main Screen
Main St. USA

In the folklore version of the story "Heidi", a young girl was sent to live with a recalcitrant grandfather in the remote mountains of Switzerland. She gradually won him over with her innocent charm, and eventually taught him to read! In your own version of Heidi, you are the stubborn grandfather, obstinately refusing to embrace all that your database has to offer. Allow Heidi SQL to shine some light into your withered database worldview, and brighten your SQL experience!

A Boy Named Matteo, a Stubborn Aunt, and Their Cows

Now that we've installed HeidiSQL, let's use it to spin some Volkskunde about a young mountain herdsman (Matteo) who must track his modest collection of Braunvieh (cattle), lest his wicked Auntie Adhelburg lash him with a Hornbeam switch. She's a cruel woman, but she's all Matteo has (and she makes a mean Älplermagronen).

Let's start by creating a database:

HeidiSQL Create Database
Presto!  We have a new database!

HeidiSQL Created Database
Hello Matteo!

What sort of information does young Matteo need to track? He's got cattle he cares for, and will need to track their weight. He may also want to make comments along the way containing observations about the individual cows:

HeidiSQL Create Table
Totally Tabular!

HeidiSQL Create Table
You have such good definition!

Now that we've defined the table, HeidiSQL allows for adding rows with GUI, and populating data. Matteo can easily add more Braunvieh as his fortunes grow:

HeidiSQL Add Data to Table
Fill 'er up!

And with the data in place, we can use good old fashion SQL to query the results. Once Matteo learns a little SQL, he is hyper-informed about all aspects of the herd:

HeidiSQL Select
You select me!

With this powerful database under his command, Matteo's days of counting cattle on his fingers are over! And if Auntie Adhelburg wishes to question him about the health of their herd, she's in for a surprise! Some simple querying will provide immediate feedback about their weight, and any recent observations Matteo has about the herd. Schöön!

Matteo's glee over this powerful tool is short-lived, however. Auntie Adhelburg saw the potential, but turned up her nose at his use of SQL Server. Apparently she's a big fan of the open source movement, and insists that any database used by their family be open source. Exasperated, Matteo starts googling, and thinks MySql may solve their needs. But he's already created the database in SQL Server! What to do now?

Thankfully, HeidiSQL can connect to multiple types of databases. SQL Server, MySql, as well as PostgreSQL! Matteo is now in control of the situation, effortlessly choosing the best database for the job. When Auntie Adhelburg witnesses this turn of events, a small burst of warmth appears in her long-shrivelled heart. Over time, she comes to love Matteo, and recaptures the energy and joy she once had in her youth. The villagers all come to think of her as their own dear sweet Aunt, and she is revered by the entire village. All because Matteo was able to use HeidiSQL to connect to SqlServer AND MySql. It is a fairy tale with a happy ending!

But Seriously Folks...

I'm obviously spicing this article up with as much Swiss-ness as I can reasonably muster, hopefully with some comedic effect. However, Heidi SQL makes for a decent choice as a SQL client, with many cool features:

  • MySQL, SQLServer, and PostgreSQL support
  • All the standard things (querying, schema, user permissions, etc)
  • Cross database import/export
  • Reporting, formatting, searching
  • SQL text formatter (this can be really handy when you've got a long block of run-on SQL!)
  • Free and Open Source

If you're looking for a cross-platform SQL Client, HeidiSQL is definitely worth taking for a spin!

SQLBot

Now that Matteo is master of his SQL destiny, there's another tool he might include in his "Sheparding IT" utility belt - SQLBot! Using SQLBot, Matteo can schedule a report to run daily against his expertly crafted database (Postgres, MySQL, SQL Server, and even Redshift), with the results posted to Slack. Using Slack, he and Auntie Adhelburg stay informed about the health of their Braunvieh. This way, Auntie Adhelburg doesn't need to learn SQL, and the daily reports keep her off Matteo's back.

As Matteo's SQL expertise grows, he can expand upon his helpful database, and continue to feed the reports into SQLBot. If his organization grows (say, a pretty young Swiss girl comes into Matteo's life, and begins managing the books. Beware Auntie Adhelburg's jealousy!), the SQLBot/Slack combination will grow with them. Important data at their fingertips, with only Matteo needing to manage the technical aspect of things (using Heidi SQL, of course!).

Now Matteo can focus on growing his business! The women in his life are happy, everyone's informed on daily progress, and the future never looked brighter! Du machsch mi glücklich, HeidiSQL!

Try SQLBot - It's Free!

Sign up for a free account on SQLBot to see how easy it is to get SQL reports into your Slack.  What are you waiting for, it's free!