MySQL 在mysql工作台中通过快捷方式执行语句
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19607448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Execute statement by shortcut in mysql workbench
提问by Jacob
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/en/wb-keys.html(Table 14.6 - query menu) but I don't know what does mean Modifier+Return ?
如何使用快捷方式在 MySQL Workbench 中执行任何语句?现在我必须按下按钮(黄色闪电)。当然我读过这个:http: //dev.mysql.com/doc/workbench/en/wb-keys.html(表 14.6 - 查询菜单)但我不知道 Modifier+Return 是什么意思?
As we can read Modifier is Ctrl (in Windows) but what is Return?
正如我们可以读到的,修饰符是 Ctrl(在 Windows 中)但什么是返回?
回答by RustProof Labs
Return = Enter key. So Ctrl + Enter key should execute.
返回 = 输入键。所以应该执行 Ctrl + Enter 键。
回答by ROMANIA_engineer
MySQL Workbench 6.3
MySQL 工作台 6.3
Default key mapping
默认键映射
Change the default mapping
更改默认映射
Open:
打开:
C:\Program Files\MySQL\MySQL Workbench 6.3 CE\data\main_menu.xml
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 Modifierand Return:
如果您搜索Execute (All or Selection)和Execute Current Statement,您还将确定(根据您在上面屏幕截图中看到的内容)Modifier和Return的含义:
- Modifier = Ctrl
- Return = Enter
- 修饰符 = Ctrl
- 返回 = Enter
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+Enteror F5, so I change the following in the main_menu.xml:
您可以在此处更改默认映射。由于熟悉 SQuirreL SQL 和 pgAdmin 等其他工具,我总是更喜欢使用Ctrl+Enter或仅运行选定的查询F5,因此我在 main_menu.xml 中更改了以下内容:
- To run the selected query using Ctrl+Enter:
- 要使用Ctrl+运行选定的查询Enter:
<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>
- Run the selected query using F5:
- 使用F5以下命令运行选定的查询:
<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.
保存文件并重新启动 MySQL Workbench 以查看更改。
回答by Akshat Bhargava
Executing statement at cursor
在游标处执行语句
Ctrl + Enter (for Windows)
Ctrl + Enter(适用于 Windows)
Executing all statements within selection
执行选择中的所有语句
Ctrl + Shift + Enter Key (for Windows)
Ctrl + Shift + Enter 键(适用于 Windows)
回答by Sagar
For mac: command + return should work. PS. this executes whatever you have in the query editor until it finds ';' .
对于 mac: command + return 应该可以工作。附注。这将执行查询编辑器中的任何内容,直到找到“;” .
回答by Vincent
回答by Swapnil Ghone
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
按Ctrl + Enter
执行您可以在以下链接https://dev.mysql.com/doc/workbench/en/wb-keys.html上找到完整的短代码列表