How can I execute any statement in MySQL Workbench using shortcut? Now I have to press buttom (yellow lightning). Of course I have read this: http://dev.mysql.com/doc/workbench/
Executing statement at cursor
Ctrl + Enter (for Windows)
Executing all statements within selection
Ctrl + Shift + Enter Key (for Windows)
see here for more
Press Ctrl + Enter
to execute
you can find full list of shortcodes on following link
https://dev.mysql.com/doc/workbench/en/wb-keys.html
For mac: command + return should work. PS. this executes whatever you have in the query editor until it finds ';' .
Return = Enter key. So Ctrl + Enter key should execute.
Execute Current Statement -> Ctrl+Enter
Open:
C:\Program Files\MySQL\MySQL Workbench 6.3 CE\data\main_menu.xml
If you search for Execute (All or Selection) and for Execute Current Statement, you'll also identify (based on what you see in the screenshot above) the meaning of Modifier and Return:
Here you can change the default mappings. Being familiar with other tools like SQuirreL SQL and pgAdmin, I always prefer to run only the selected query using Ctrl+Enter or F5, so I change the following in the main_menu.xml:
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.exec">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute (All or Selection)</value>
<value type="string" key="name">query.execute</value>
<value type="string" key="command">builtin:query.execute</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">Modifier+Return</value>
</value>
...
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute Current Statement</value>
<value type="string" key="name">query.execute_current_statement</value>
<value type="string" key="command">builtin:query.execute_current_statement</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">Modifier+Shift+Return</value>
<value type="string" key="platform">windows</value>
</value>
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.exec">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute (All or Selection)</value>
<value type="string" key="name">query.execute</value>
<value type="string" key="command">builtin:query.execute</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">F5</value>
</value>
Save the file and restart MySQL Workbench to see the changes.
On Mac, the shortcut is
Command + Enter
You can find all keyboard shortcuts from link