Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interactive command line from within MySQL workbench

I've been writing and running queries from within MySQL workbench's SQL Query Panel. However, sometimes I need to run a one-off command (e.g. adding indices) that I don't want to save.

Right now, I write it in the query file, run, then delete from the file. Can I open a command line within MySQL workbench to run these one-off commands? If not, is it okay if I open another database connection from my OS terminal alongside my MySQL workbench connection?

like image 360
Heisenberg Avatar asked Jul 08 '14 16:07

Heisenberg


People also ask

How do I run a MySQL query from the command line?

Type your SQL command followed by a semi-colon (;) and press the Enter key. The response from the server should be displayed on your screen. To get out of mysql, type quit at the prompt and press the Enter key.

How do I interact with a MySQL database?

To Connect to a MySQL Database Expand the Drivers node from the Database Explorer. Right-click the MySQL (Connector/J driver) and choose Connect Using.... The New Database Connection dialog box is displayed. In the Basic Setting tab, enter the Database's URL <HOST>:<PORT>/<DB> in the corresponding text field.

How do you comment a line in a workbench?

select the text to be commented. press Fn key. press CTRL+/


1 Answers

New Query

Click the first item in the toolbar. The "SQL" with the "+" sign. You'll get a new query tab. If you don't want to save the new query, just don't click the Save icon. Close the tab when you're done.

like image 53
Marcus Adams Avatar answered Oct 03 '22 13:10

Marcus Adams