
{"id":1366,"date":"2020-04-24T11:14:43","date_gmt":"2020-04-24T01:14:43","guid":{"rendered":"https:\/\/www.bakke.online\/?p=1366"},"modified":"2022-01-22T20:10:55","modified_gmt":"2022-01-22T09:10:55","slug":"mysql-workbench-adding-f5-to-execute","status":"publish","type":"post","link":"https:\/\/www.bakke.online\/index.php\/2020\/04\/24\/mysql-workbench-adding-f5-to-execute\/","title":{"rendered":"MySQL Workbench: Adding F5 to execute"},"content":{"rendered":"<p>I&#8217;ve been using Microsoft&#8217;s SQL Server Management Studio since it was called Enterprise Manager, way back when.<br \/>\nOver the years, I have become so accustomed to using F5 to run queries that when even after a long time using MySQL Workbench, muscle memory rules and I still hit F5 and wonder why my queries don&#8217;t run&#8230;<\/p>\n<p>Luckily, MySQL Workbench is configurable so the keyboard shortcuts can be changed.<\/p>\n<p>To make MySQL Workbench behave more like SSMS, open an administrative command prompt (editing the configuration file requires administrator access) and CD to the directory MySQL Workbench has been installed in.<br \/>\nIn there, you&#8217;ll find a directory called &#8220;data&#8221;, so CD into that. For version 8.0 installed on 64-bit Windows, I have this as <code>cd \"\\Program Files\\MySQL\\MySQL Workbench 8.0 CE\\data\"<\/code><\/p>\n<p>You&#8217;ll need to edit the file called main_menu.xml. I&#8217;ll just use notepad for this: <code>notepad main_menu.xml<\/code><\/p>\n<p>There are quite a few entries in this file for executing queries, but the one which makes it behave most like SSMS is the one which has an id of <code>com.mysql.wb.menu.query.exec<\/code>. The caption in version 8.0 is <code>Execute (All or Selection)<\/code>. Change the shortcut to <code>F5<\/code>, as shown below:<\/p>\n<blockquote><p>&lt;value type=&#8221;object&#8221; struct-name=&#8221;app.MenuItem&#8221; id=&#8221;com.mysql.wb.menu.query.exec&#8221;&gt;<br \/>\n&lt;link type=&#8221;object&#8221; key=&#8221;owner&#8221; struct-name=&#8221;app.MenuItem&#8221;&gt;com.mysql.wb.menu.query&lt;\/link&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;accessibilityName&#8221;&gt;Execute All or Selection&lt;\/value&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;caption&#8221;&gt;Execute (All or Selection)&lt;\/value&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;name&#8221;&gt;query.execute&lt;\/value&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;command&#8221;&gt;builtin:query.execute&lt;\/value&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;itemType&#8221;&gt;action&lt;\/value&gt;<br \/>\n&lt;value type=&#8221;string&#8221; key=&#8221;shortcut&#8221;&gt;F5&lt;\/value&gt;<br \/>\n&lt;\/value&gt;<\/p><\/blockquote>\n<p>When done, save and close the file and then restart MySQL Workbench. The Query menu will show F5 as the shortcut for the <code>Execute All or Selection<\/code> menu.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bakke.online\/wp-content\/uploads\/2020\/04\/querymenu-300x113.jpg\" alt=\"\" width=\"300\" height=\"113\" class=\"alignnone size-medium wp-image-1367\" srcset=\"https:\/\/www.bakke.online\/wp-content\/uploads\/2020\/04\/querymenu-300x113.jpg 300w, https:\/\/www.bakke.online\/wp-content\/uploads\/2020\/04\/querymenu.jpg 381w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using Microsoft&#8217;s SQL Server Management Studio since it was called Enterprise Manager, way back when. Over the years, I have become so accustomed to using F5 to run queries that when even after a long time using MySQL Workbench, muscle memory rules and I still hit F5 and wonder why my queries don&#8217;t &hellip; <a href=\"https:\/\/www.bakke.online\/index.php\/2020\/04\/24\/mysql-workbench-adding-f5-to-execute\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MySQL Workbench: Adding F5 to execute&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[34],"class_list":["post-1366","post","type-post","status-publish","format-standard","hentry","category-databases","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/posts\/1366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/comments?post=1366"}],"version-history":[{"count":1,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/posts\/1366\/revisions"}],"predecessor-version":[{"id":1368,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/posts\/1366\/revisions\/1368"}],"wp:attachment":[{"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/media?parent=1366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/categories?post=1366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bakke.online\/index.php\/wp-json\/wp\/v2\/tags?post=1366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}