- F9 runs all queries in the tab, Ctrl+F9 runs the selection, Ctrl+Shift+F9 runs the query under the cursor.
- Ctrl+T opens a new query tab, Ctrl+Space shows SQL completion, Ctrl+F8 reformats SQL.
- In the data grid: F2 edits a cell, Insert adds a row, Ctrl+Enter posts changes, Esc cancels, Ctrl+Shift+N sets NULL.
- Ctrl+D jumps to the database tree, Ctrl+E to the table filter, F6 switches between query and results.
- All shortcuts are customisable in Tools > Preferences > Shortcuts, which has a filter box since 12.18.
HeidiSQL shortcuts for running and editing SQL
| Action | Windows and Linux |
|---|---|
| Run all queries in the tab | F9 |
| Run selection | Ctrl+F9 |
| Run current query (at the cursor) | Ctrl+Shift+F9 |
| Cancel running operation | Esc |
| New query tab | Ctrl+T |
| Close query tab | Ctrl+F4 |
| Clear query editor (or filter editor) | Ctrl+W |
| Load SQL file | Ctrl+O |
| Save SQL to file | Ctrl+S |
| Save as | F12 |
| Save selection to file | Ctrl+Shift+S |
| Reformat SQL | Ctrl+F8 |
| Show SQL completion proposal | Ctrl+Space |
| Move line up / down | Alt+Up / Alt+Down |
| Selection to upper case | Ctrl+U |
| Selection to lower case | Ctrl+L |
| Delete word | Ctrl+Del |
| SQL help browser | F1 |
| Previous / next result tab | Alt+Left / Alt+Right |
| Switch between query and results | F6 |
| Clear query log | Ctrl+Q |
Search and filter
| Action | Windows and Linux |
|---|---|
| Find text | Ctrl+F |
| Replace text | Ctrl+R |
| Find or replace again | F3 |
| Find text on server (search all tables) | Ctrl+Shift+F |
| Filter panel | Ctrl+Alt+F |
| Multi column filter (data tab) | F7 |
| Apply filter | F9 |
| Quick filter: column equals focused value | Ctrl+Shift+1 |
| Quick filter: column not equal to focused value | Ctrl+Shift+2 |
| Quick filter: column equals prompted value | Ctrl+Shift+3 |
| Quick filter: column not equal to prompted value | Ctrl+Shift+4 |
| Quick filter: column equals clipboard | Ctrl+Shift+5 |
| Quick filter: column not equal to clipboard | Ctrl+Shift+6 |
Editing data in the grid
Ctrl+Del deletes selected rows in a grid and deletes a word in the SQL editor; the focused panel decides which applies.
| Action | Windows and Linux |
|---|---|
| Edit the focused cell | F2 |
| Insert row | Insert |
| Duplicate row without keys | Ctrl+Insert |
| Delete selected rows | Ctrl+Del |
| Post (save) changes | Ctrl+Enter |
| Cancel editing | Esc |
| Set focused cell to NULL | Ctrl+Shift+N |
| Insert SQL function call in cell, e.g. NOW() | Ctrl+F2 |
| Reset sorting | Alt+S |
| Load next rows | Ctrl+Alt+Page Down |
| Show all rows | Ctrl+Alt+End |
| Select all | Ctrl+A |
| Invert selection | Ctrl+I |
| Copy / cut / paste | Ctrl+C / Ctrl+X / Ctrl+V |
| Copy with tabs to spaces | Ctrl+Shift+C |
| Undo | Alt+Backspace |
| Print list or data | Ctrl+P |
Navigation, tree and windows
| Action | Windows and Linux |
|---|---|
| Go to database tree | Ctrl+D |
| Go to table filter | Ctrl+E |
| Go to main tab 1 to 5 | Ctrl+1 to Ctrl+5 |
| Next / previous tab | Ctrl+Tab / Ctrl+Shift+Tab |
| Edit selected object (tree) | Alt+Enter |
| Empty table(s) | Shift+Del |
| Refresh | F5 |
| Full status refresh | Shift+F5 |
| Auto refresh (process list and similar) | Ctrl+F5 |
| Kill process (process list) | Del |
| New window | Ctrl+N |
| Exit | Alt+F4 |
Changing shortcuts, and macOS
Customise. Open Tools > Preferences and the Shortcuts tab. Select an action in the tree, then set a Shortcut and an optional Secondary shortcut; release 12.18 added a filter box to find actions quickly. Custom keys override the defaults listed here.
macOS. The macOS app is built from the same Lazarus code base and defines the same shortcut values, but HeidiSQL does not document how Ctrl and Alt map to the Command and Option keys on a Mac. Check the menus or the Shortcuts tab on your Mac rather than assuming a mapping.
For more on HeidiSQL itself, see the HeidiSQL review.
Frequently asked questions
What is the shortcut to run a query in HeidiSQL?
F9 runs all queries in the tab, Ctrl+F9 runs the selected text, and Ctrl+Shift+F9 runs only the query at the cursor.
How do I format SQL in HeidiSQL?
Press Ctrl+F8 (Reformat SQL). The help page also recommends it for views that MySQL has collapsed into one line.
How do I set a cell to NULL in HeidiSQL?
Press Ctrl+Shift+N on the focused cell, then Ctrl+Enter to post the change.
Can I change HeidiSQL keyboard shortcuts?
Yes, in Tools > Preferences > Shortcuts, with a primary and secondary shortcut for each action.
Is there a printable HeidiSQL shortcut list?
Use the print button on this page. HeidiSQL itself does not publish a PDF cheat sheet.
Sources
- HeidiSQL source: main window actions and shortcuts (main.dfm)
- HeidiSQL source: Preferences dialog (preferences.dfm)
- HeidiSQL help page (shortcuts mentioned in the text)
- HeidiSQL v12.18 release notes
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.