Exporting query results in MySQL Workbench beyond 1000 records
LOAD DATA INFILE
has a sibling called SELECT ... INTO OUTFILE. You can use it like:
SELECT * FROM mytable
INTO OUTFILE '/tmp/mytable.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
This method will not use unnecessary resources in the UI.
As @florian pointed out: It will, however, create the output file on the database server, not on the client machine.
Also note that security frameworks like SELinux or AppArmor might prevent MySQL from writing files outside the standard databases folder. If you experience permission denied errors, even though the directory is writable by the mysql
user, it is likely be one of these.
It is possible to change the query result row limit, or remove the limit entirely.
Go to Edit → Preferences → SQL Editor (tab). If you can't find Query Results, go to SQL Queries(tab) instead.
Locate the Query Results section and untick the Limit Rows checkbox
Click OK.
Re-run your query.