In MySQL Workbench, follow these steps to run a query.
Run/Execute a Query in MySQL Workbench
- Open MySQL Workbench and connect to the database and set a default database.
- Then open an SQL editor by clicking on the menu File > New Query Tab or by pressing the key Ctrl+T.
- Then in the SQL editor type your query, for example, select * from customer, then press Ctrl+Enter to run the current query in MySQL Workbench. To run the whole SQL script press Ctrl+Shift+Enter.
- You can also click the buttons highlighted below in the image. Button 1 to execute the whole script and button 2 to run the query under the cursor.