MySQL Workbench Keyboard Shortcut Keys: Complete List (With Functions Explained)

MySQL Workbench is Oracle's official visual tool for MySQL — the place where database developers and administrators design schemas, write SQL, run queries and keep an eye on the server. Its SQL editor has proper developer shortcuts: run the current statement or everything, beautify SQL, comment lines out, and manage query tabs without the menus. Around that editor sit a modeling studio for EER diagrams and an Object Browser for exploring schemas. This complete list of MySQL Workbench keyboard shortcut keys explains the editor and modeling shortcuts in plain words, with the situations where each one earns its place.

Most people use Workbench with the mouse for far longer than they need to. They click the lightning-bolt icon to run a query, dig through the Edit menu to format SQL, and scroll a five-hundred-line script hunting for the one statement that failed. Every one of those jobs has a key: Ctrl + Enter runs, Ctrl + B beautifies, Ctrl + / comments. Learn a handful of them and the whole tool changes character — scripts open, run, break and get fixed in a rhythm that never leaves the keyboard.

This guide covers all twenty-five shortcuts from the two tables below: seventeen for the SQL editor, and eight for modeling and the application itself.

Why Keyboard Shortcuts Matter So Much in MySQL Workbench

SQL work is iterative in a way that punishes mouse users. You write a statement, run it, read the result, change one condition, run it again. A debugging session repeats that loop fifty times, and if every run costs a trip to the toolbar, the tool itself becomes the bottleneck. Ctrl + Enter removes the trip entirely. The same is true of Ctrl + Shift + Enter when you deliberately want the whole script, and the distinction between those two keys is the single most important habit in Workbench, because one runs a single statement and the other runs everything in the tab.

There is a second reason, and it is about reading other people's SQL. Real-world scripts are inherited — written in a hurry, with no indentation at all. A wall of unformatted SQL is genuinely hard to debug. Ctrl + B — Beautify Query — re-indents and capitalizes the whole thing in one press, turning an unreadable block into a structure you can scan. Pair it with Ctrl + / to comment out sections while you isolate a problem, and Ctrl + F to jump straight to the table name you care about, and a frightening script becomes manageable.

A practical note before the tables: these shortcuts are written for Windows and Linux, which is where most Workbench users sit. The editor keys act on the window and panel that currently have focus — the SQL editor, the Object Browser on the left, or a modeling canvas — and a few keys change meaning with context, which is why some table entries name their context in brackets. The tables below use the standard key combinations, so what you practise here matches what the tool does.

SQL Editor Shortcuts

The SQL editor is where you will spend the large majority of your Workbench hours, and its seventeen shortcuts cover the complete loop of writing, running, fixing and filing a script. Read the table first, then work through the notes underneath — the difference between similar keys, like executing one statement versus all of them, is where time is saved and accidents are avoided.

Shortcut KeyFunction
Ctrl + EnterExecute the current SQL statement (at the cursor)
Ctrl + Shift + EnterExecute ALL statements in the editor
Ctrl + BBeautify Query (auto-format the SQL)
Ctrl + /Comment / uncomment the selected lines (-- )
Ctrl + U / Ctrl + Shift + UMake the selection lowercase / UPPERCASE
Ctrl + TOpen a new SQL query tab
Ctrl + WClose the current tab
Ctrl + Tab / Ctrl + Shift + TabSwitch between open tabs
Ctrl + OOpen an SQL script file
Ctrl + S / Ctrl + Shift + SSave the script / Save As
Ctrl + F / Ctrl + HFind / Find and Replace in the editor
Ctrl + GGo to a line number
Ctrl + Z / Ctrl + YUndo / redo
Tab / Shift + Tab (lines selected)Indent / unindent the lines
Ctrl + ASelect all SQL in the editor
Ctrl + R (Object Browser focused)Refresh the schemas/objects list
Ctrl + Shift + NCreate a new model (from the Home/model context)

Start with the pair you will press more than any others. Ctrl + Enter executes the statement at the cursor — Workbench works out the statement boundaries from the semicolons around where your cursor sits, and runs just that one. This is the safe, surgical way to work inside a long script: park the cursor in the SELECT you are tuning, press Ctrl + Enter, and only that statement reaches the server. Ctrl + Shift + Enter is the opposite commitment: it executes all statements in the editor, top to bottom, the way the script will eventually run in production. Use it when you mean it — after you have read the whole tab — because everything in the file goes, including test deletes and half-finished experiments.

Ctrl + B: Beautify Query re-formats the SQL in the editor — indentation normalized, keywords capitalized — so clauses line up. Run it the moment you open inherited SQL, before you change a single character, because half of all "broken" scripts are simply unreadable ones. If you prefer your keywords in a particular case while you type, Ctrl + U turns a selection lowercase and Ctrl + Shift + U makes it UPPERCASE, handy for matching a team's style guide. And when you are narrowing down a bug, select a block of lines and press Ctrl + / to comment them out with -- markers; press it again on the same selection to bring them back. Commenting a section, running what remains, and uncommenting step by step is the fastest honest way to find which part of a script is lying to you.

Tabs are how you keep parallel work apart. Ctrl + T opens a fresh query tab inside your connection — one tab for the query you are developing, one for the quick check you need to run against a different table, one for the script a colleague sent you. Ctrl + Tab and Ctrl + Shift + Tab walk forward and backward through the open tabs, and Ctrl + W closes the one you are standing in. That last key deserves respect: an unsaved tab closed by accident is work you will write twice. The defence is a reflex — Ctrl + S before Ctrl + W, every time. Ctrl + S saves the script in the current tab, Ctrl + Shift + S saves it under a new name, and Ctrl + O opens an existing .sql file into a new tab when someone hands you a script on disk.

The remaining editor keys are the quiet infrastructure of a fast session. Ctrl + F finds text in the editor and Ctrl + H finds and replaces it — rename a table across a forty-statement script in seconds instead of editing each occurrence by hand. Ctrl + G jumps to a line number, which becomes essential the first time an error message tells you the problem is on line 312. Ctrl + Z and Ctrl + Y undo and redo your edits, Tab and Shift + Tab indent or unindent selected lines so nested blocks stay readable, and Ctrl + A selects everything when you want to beautify, copy or clear the whole tab. Finally, two keys look outside the editor itself: with the Object Browser focused, Ctrl + R refreshes the schemas and objects list, so tables created by another tool or another user appear without restarting Workbench; and Ctrl + Shift + N starts a new model — the subject of the second table in this guide.

The Daily Query Workflow, Step by Step

Here is the sequence experienced Workbench users run without thinking. Open your connection, then press Ctrl + T for a clean query tab instead of overwriting yesterday's scratch work. Type or paste your SQL. If it arrived as an unformatted block, press Ctrl + B before you read it — two seconds of beautifying saves ten minutes of squinting. Place the cursor inside the first statement and press Ctrl + Enter. Read the result grid: row count first, then the actual values, because a query that returns the wrong number of perfect-looking rows is still wrong. Adjust one condition, press Ctrl + Enter again, and compare. That tight loop — edit, run, read, adjust — is where queries actually get built.

When the statement works, widen the lens. If the tab holds a script that must run as a unit, read it once from top to bottom, then press Ctrl + S to save it, and only then Ctrl + Shift + Enter to run everything. If something fails halfway, the error message names a line; Ctrl + G takes you straight to it. Select the statements after the failure and toggle them off with Ctrl + / while you fix the broken one, run it alone with Ctrl + Enter until it passes, then uncomment the rest and save again.

Keep one more habit from the Object Browser side of the window. Schemas change while you work — a migration runs, a teammate creates a table, you create one yourself in another tab. When the browser's list looks stale, click into it and press Ctrl + R to refresh the schemas and objects rather than reconnecting. It prevents the classic confusion of querying a table that "does not exist" when it was created minutes ago in another session.

Modeling and App Shortcuts

The second half of Workbench is the modeling studio, where schemas are designed as EER diagrams before they exist as tables. Its shortcuts are fewer — eight — but they cover the whole life of a model: creating one, opening one, arranging it, renaming its pieces and cleaning it up.

Shortcut KeyFunction
Ctrl + NNew model/document (from the modeling home)
Ctrl + Shift + OOpen a model file (.mwb)
Ctrl + mouse wheel (EER diagram)Zoom the diagram in/out
Delete (object selected on a diagram)Delete the selected table/object from the diagram
Ctrl + C / Ctrl + X / Ctrl + VCopy / cut / paste objects and text
F2 (on a table/object name)Rename the selected object in the catalog tree
EscClose dialogs
F1Help

Creating and opening models mirrors the editor's file keys with a modeling twist: Ctrl + N starts a new model from the modeling home, Ctrl + Shift + N creates one from the Home or model context, and Ctrl + Shift + O opens an existing .mwb model file. Once a diagram is open, it can grow to dozens of tables, and navigation becomes the problem. Hold Ctrl and roll the mouse wheel to zoom the EER diagram in and out — out to see the whole design, in to read one table's columns. Zooming with the wheel, instead of hunting for zoom controls, keeps your pointer on the table you were examining.

Editing a diagram is mostly rearranging and renaming. Ctrl + C, Ctrl + X and Ctrl + V copy, cut and paste objects and text, so a well-built table design can be duplicated and adapted instead of rebuilt column by column. F2 renames the selected object in the catalog tree — select a table, press F2, type the better name, and the diagram and catalog stay in agreement. Delete removes the selected object from the diagram, so treat it the way you treat Ctrl + Shift + Enter: a deliberate key, pressed after a look, not a reflex. And across the whole application, Esc closes dialogs when you opened one by mistake, and F1 opens Help — the fastest route to the official word on any feature you are unsure about.

Three Keyboard-Only Workflows to Practice

First, the inherited-script cleanup. A colleague sends you a .sql file written as one unformatted block. Press Ctrl + O to open it, Ctrl + A to select everything, and Ctrl + B to beautify it into readable shape. Press Ctrl + S to save your formatted copy, then place the cursor in the first statement and step through the script with Ctrl + Enter, one statement at a time.

Second, the safe production run. Open the script, save it with Ctrl + S, and comment out any statement that should not run today — a seed insert, a one-off update — using Ctrl + /. Press Ctrl + Shift + Enter to run everything that remains, watch the output for errors, and use Ctrl + G to jump to any line an error names. When it completes cleanly, uncomment the parked statements and save again, so the file on disk matches what actually ran.

Third, the diagram review. Open the model with Ctrl + Shift + O. Zoom out with Ctrl + mouse wheel until the whole schema fits the screen and look for tables stranded far from everything they relate to. Zoom back in on one table, press F2 in the catalog tree to fix a name that no longer matches the real database. Ten minutes of this, once a month, keeps a model honest.

12 Power Tips for Daily MySQL Workbench Work

One, learn the Ctrl + Enter versus Ctrl + Shift + Enter distinction before anything else: run just the statement under your cursor while debugging scripts, and everything only when you mean it. Two, press Ctrl + B on inherited messy SQL before you touch it — beautified SQL is readable SQL, and readable SQL gets fixed faster. Three, save with Ctrl + S before running long scripts; an unsaved tab closed by Ctrl + W is gone work. Four, comment with Ctrl + / instead of deleting: commented code is an undo that survives saving the file.

Five, keep one tab per task with Ctrl + T, and walk them with Ctrl + Tab rather than piling unrelated queries into one tab. Six, use Ctrl + H when a name changes — a table or column rename is a find-and-replace job, not a typing job. Seven, jump with Ctrl + G the moment an error names a line; scrolling to line 312 is time you will never get back. Eight, refresh the Object Browser with Ctrl + R after anything creates a table outside your current tab, so "table doesn't exist" never sends you chasing a ghost.

Nine, match keyword case deliberately with Ctrl + U and Ctrl + Shift + U so your SQL follows one style instead of three. Ten, keep indentation honest with Tab and Shift + Tab on selected lines. Eleven, on diagrams, zoom with Ctrl + mouse wheel before you move tables around; most "messy" diagrams are just diagrams seen at the wrong zoom. Twelve, press F1 when a feature puzzles you instead of guessing — Workbench's help is thorough, and one minute reading beats twenty minutes experimenting on a live schema.

Customizing Workbench: Settings Worth Changing Once

Workbench's preferences (under the Edit menu on Windows and Linux) repay a single careful visit. In the SQL Editor section you can set the font size, tab width, and whether queries ask for confirmation before running — worth thinking about if you ever connect to a production server. The Modeling section controls diagram defaults such as how tables and relationships are drawn, which decides whether your EER diagrams come out tidy or need rearranging every time.

Connections deserve the same one-time care. Give every saved connection a name that states its environment — local, staging, production — and consider the colour coding Workbench offers for connection tabs, because the cheapest database accident there is remains running the right script on the wrong server. With names and colours set once, the tab habits from this guide become safe as well as fast.

Troubleshooting: When a Shortcut or a Query Does Not Work

Most "the shortcut did nothing" reports in Workbench are focus problems. Ctrl + R refreshes the Object Browser only when the Object Browser has focus; pressed while you are standing in the editor, it is not the refresh you wanted. Click once in the panel you mean to command, then press the key. Similarly, Ctrl + Enter runs the statement at the cursor — if the cursor is sitting in a blank gap between statements, Workbench may run the nearest statement or none at all, so put the cursor inside the statement you intend before you press it. And if Ctrl + Shift + Enter runs things you did not expect, remember it promises everything in the tab — scroll the whole tab before you use it.

If a run returns far more rows than expected, check whether a commented-out filter was doing real work — toggle the comments with Ctrl + / and look again. If find cannot locate text you can see, check whether you are searching the editor while the text lives in the result grid; each panel searches its own contents. If a table you just created is missing from the Object Browser, refresh it with Ctrl + R before assuming the CREATE failed. And if a tab vanishes, assume Ctrl + W before you assume the tool crashed — reopen the file with Ctrl + O if you had saved.

Frequently Asked Questions

How do I run a query in MySQL Workbench?

Press Ctrl + Enter to run the statement at the cursor, or Ctrl + Shift + Enter to run the whole editor.

How do I format SQL in MySQL Workbench?

Press Ctrl + B (Beautify Query) — Workbench re-indents and capitalizes the query.

How do I comment out SQL lines in MySQL Workbench?

Select the lines and press Ctrl + / to toggle -- comments on and off.

How do I open a new query tab in MySQL Workbench?

Press Ctrl + T inside a connection; Ctrl + W closes the tab when you’re done.

What is the difference between Ctrl + Enter and Ctrl + Shift + Enter?

Ctrl + Enter runs only the statement your cursor is inside; Ctrl + Shift + Enter runs every statement in the editor tab, in order. Debug with the first, and use the second only after reading the whole tab.

How do I recover a script after closing its tab by accident?

If you had saved, reopen it with Ctrl + O. If you had not saved, the work is usually gone — which is why this guide insists on Ctrl + S before Ctrl + W, every time.

How do I rename a table in a model?

Select the table or object in the catalog tree and press F2, then type the new name. The diagram and the catalog stay in sync.

How do I zoom an EER diagram?

Hold Ctrl and roll the mouse wheel while the diagram is in front of you — wheel up zooms in, wheel down zooms out.

My schemas list is out of date. How do I update it?

Click into the Object Browser so it has focus, then press Ctrl + R to refresh the schemas and objects list.

Is MySQL Workbench free?

Yes — Workbench is Oracle's free graphical tool for MySQL, available for Windows, macOS and Linux, and it connects to local, self-hosted and hosted MySQL servers alike.

Conclusion

MySQL Workbench's twenty-five shortcuts divide neatly into the two halves of the tool: seventeen that run the SQL editor — executing, beautifying, commenting, finding, saving — and eight that run the modeling studio and the application around it. Start with the five that carry the daily loop: Ctrl + Enter to run one statement, Ctrl + Shift + Enter to run a script, Ctrl + B to make SQL readable, Ctrl + / to isolate a problem, and Ctrl + S so none of it is ever lost. Add tabs, find-and-replace and line-jumping as your scripts grow, and the modeling keys when diagrams become part of your work.

Within a week of deliberate practice, the rhythm becomes automatic: open a tab, beautify, run one statement at a time, save, and only then run everything. The mouse becomes what it should be in a database tool — something you use for looking at result grids and diagrams, not for commanding the editor. Your attention stays where it belongs: on the data, the schema, and the question you were actually asking. Let the keyboard handle the rest.

By Umar Farooq, Tech Know.

Post a Comment

0 Comments