8/21/2014 2:37:17 AM

If you are like me and coming from a SQL Server background, you have been clicking F5 for years to run your queries in SQL Management Studio. So when you open up MySQL Workbench, you instinctively do the same thing...But it doesn't work. So here is a simple key mapping change to make it work (like it's supposed to).

  1. Open up the MySQL Workbench menu file.
  2. C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.9\data\main_menu.xml
    or
    C:\Program Files\MySQL\MySQL Workbench CE #.##\data\main_menu.xml
  3. Search for the following string:
    com.mysql.wb.menu.query.execute_current_statementwin
  4. Update that xml section. Replace:
    <value type="string" key="shortcut">Modifier+Return</value>
    with
    <value type="string" key="shortcut">F5</value>
  5. Save the file, close and re-open MySQL Workbench and you should be all set.
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin"> ... <value type="string" key="shortcut">F5</value> ... </value>

To set F5 to execute everything or the currently highlighted section, update the com.mysql.wb.menu.query.exec xml section.
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.exec"> ... <value type="string" key="shortcut">F5</value> .... </value>