- There is no HeidiSQL ER diagram designer or viewer in version 12.21, and none is planned.
- GitHub issue #2117 (ERD editing and visualisation) is labelled wontfix and closed as not planned; the author said it is beyond what he could implement himself.
- Inside HeidiSQL, use the table editor's Foreign keys tab, which since 12.17 can also list reverse foreign keys (tables that reference this one).
- To get a diagram, export the structure with Tools > Export database as SQL (Data: No data) and open it in a modelling tool, or connect that tool to the database directly.
Does HeidiSQL have an ER diagram feature?
No. The HeidiSQL home page lists its features (multiple connections, SSH and SSL, table and routine editors, SQL export, server to server export, text file import, grid exports, user management and more), and an ER diagram is not among them. On GitHub, two feature requests for one were closed:
- Issue #832, "Generating ER diagram of database structure". The author asked for more detail, closed it, and later wrote that he did not think "such a graphical mega feature" would get done by him, floating the idea of passing the structure to an online diagram tool.
- Issue #2117, ERD editing and visualisation. The author replied that this is beyond what he could implement himself and would need an easily adoptable Delphi component; it is labelled wontfix ("Nothing planned") and closed as not planned.
The project's contribution rules also say pull requests are accepted only for bug fixes, not new features, so an outside contributor cannot simply add one. If you came here for a HeidiSQL ER diagram tutorial, the honest answer is to use HeidiSQL for data and structure work and another tool for the diagram.
Seeing relationships inside HeidiSQL
- Foreign keys tab. Open a table in the table editor and switch to Foreign keys to see its outgoing keys. Release 12.17 added reverse foreign keys on this tab, so you also see which tables point to the current one, with a toolbar button to switch the listing off because the lookup can be slow.
- Columns in the tree. Release 12.21 can show table columns as child nodes in the database tree, with index icons, as an opt-in display option.
- Grid lookups. When you edit a foreign key column in the data grid, HeidiSQL can offer a drop-down of values from the referenced table (12.21 enabled this in SQL Server mode too).
- A query. On MySQL and MariaDB,
INFORMATION_SCHEMA.KEY_COLUMN_USAGElists every foreign key column and the table and column it references, which is the raw material of a diagram.
-- MySQL / MariaDB
SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME,
REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_SCHEMA = 'mydb'
AND REFERENCED_TABLE_NAME IS NOT NULL
ORDER BY TABLE_NAME, CONSTRAINT_NAME, ORDINAL_POSITION;Export the schema for a diagram tool
HeidiSQL's SQL export, documented on the help page, can write a structure-only script that diagram tools can read:
- Select the database in the tree and choose Tools > Export database as SQL.
- Tick the tables to include and set table creation options (create, and optionally drop first).
- Set Data to No data for a structure-only export.
- Under Output, pick a single
.sqlfile (or clipboard). - Run the export, then import or reverse engineer that script in your modelling tool.
Many diagram tools can instead connect to the database and read foreign keys directly, which keeps the diagram in step with the live schema. Either way, foreign keys must exist in the database; tables linked only by naming convention will appear unconnected.
Tools that draw ER diagrams
If diagrams are a regular need, a client that includes them may suit you better than HeidiSQL plus a second tool. Our guides cover the options: best ER diagram tools, the MySQL Workbench review for MySQL-only modelling, and the DBeaver review for a free cross-database client. For a direct comparison see DBeaver vs HeidiSQL and HeidiSQL vs MySQL Workbench.
Frequently asked questions
Can HeidiSQL generate an ER diagram?
No. HeidiSQL 12.21 has no ER diagram feature, and the related GitHub requests were closed by the author, the latest as not planned.
Will HeidiSQL add ER diagrams in version 13?
Nothing published says so. Version 13 is a new code base shared with the Linux and macOS builds, and the ERD request remains labelled wontfix.
How can I see foreign keys in HeidiSQL?
Open the table and use the Foreign keys tab in the table editor. Since 12.17 it can also show reverse foreign keys, the tables that reference the current one.
What free tool can draw a diagram of a MySQL database?
See our ER diagram tools guide; MySQL Workbench and DBeaver are covered in their reviews.
Sources
- HeidiSQL home page (feature list)
- HeidiSQL help: SQL export
- HeidiSQL issue #2117: ERD editing and visualisation (wontfix)
- HeidiSQL issue #832: generating ER diagram of database structure
- HeidiSQL GitHub repository (contribution rules)
- HeidiSQL 12.17 release notes
- HeidiSQL v12.21 release notes
- HeidiSQL source: main window definition (main.dfm)
- MySQL 8.4 Reference Manual: INFORMATION_SCHEMA KEY_COLUMN_USAGE
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.