Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy MySQL Workbench query output to clipboard

I've used Microsoft SQL Server Management Studio and one feature allowed me to run an SQL script and copy the output table to my clipboard. Something like this:

enter image description here

When I right click on my output table in MySQL Workbench, I can only copy the row content.

Does anyone know how to copy the whole table including headers?

like image 260
Scott Horvath Avatar asked May 27 '15 14:05

Scott Horvath


People also ask

How do I save a query in MySQL workbench?

The statements entered can be saved to a file or snippet for later use. At any point, you can also execute the statements you have entered. To save a snippet of code entered into the query editor, click Save SQL to Snippets List ( ) from the SQL query toolbar, enter a name (optional), and click OK.

How do I copy a column value in MySQL workbench?

To copy from one column to another, you can use INSERT INTO SELECT statement.


2 Answers

Follow these steps in the workbench to get the data and the header rows into Excel.

  1. Click on the box to the left of the first column on any data record.
  2. Click on the header on the box to the left of the column headers.
  3. Do a Ctrl+C to copy the data to the clipboard.
  4. Do a Ctrl+V to paste the data to your excel file.

Like so:

Visual Example for Step 1 & 2

like image 180
Vishal Avatar answered Sep 20 '22 17:09

Vishal


You may have an old version of MySQL Workbench. I can press Ctrl+A on Win or Cmd+A on Mac to select all records. Then Ctrl/Cmd+C to copy to clipboard (or use the "Copy Row" entry which should probably just be named "Copy").

like image 27
Mike Lischke Avatar answered Sep 21 '22 17:09

Mike Lischke