Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting query results in MySQL Workbench beyond 1000 records

I'm trying to save a query result of about 1,000,000 records in MySQL Workbench.

When I run the SELECT, only 1000 records shows up (MySQL Workbench's default limit). I know I can change the limit, or remove the limit, but I don't want 1,000,000 records to be loaded into the result panel (which might crash my computer?), but I do want to save the results to a file.

Does MySQL Workbench let you save the results of a query directly to a file? Or save the whole result set instead of the 1,000?

like image 701
think.arthur Avatar asked Apr 23 '12 21:04

think.arthur


People also ask

How do I fetch more than 1000 records in SQL Workbench?

To avoid a situation like this where your resources of Server or Client are blocked by unwanted queries; MySQL Workbench has limited the number of rows to be retrieved by any single query to 1000. You can easily change this limit by going to MySQL Workbench >> Edit >> Preferences >> SQL Queries tab.


1 Answers

It is possible to change the query result row limit, or remove the limit entirely.

  1. Go to Edit → Preferences → SQL Editor (tab). If you can't find Query Results, go to SQL Queries(tab) instead.

  2. Locate the Query Results section and untick the Limit Rows checkbox

  3. Click OK.

  4. Re-run your query.

like image 77
user86614 Avatar answered Sep 22 '22 06:09

user86614