Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL workbench table data export extremely slow

I just downloaded the newest version of MySQL Workbench (6.3.6) and attempted to export a remote table (on Google CloudSQL) to csv using the new "table data export" wizard. The table had about 600,000 rows and the final downloaded size was about 75MB. It took 7.5 hours.

I realize I can use Google Developer Console to perform this export (which I did, and took about 15 seconds), but it seems that something is wrong with MySQL Workbench. Could there be a configuration issue which is causing this to go so slowly?

like image 936
Dave Novelli Avatar asked Jan 07 '16 19:01

Dave Novelli


1 Answers

I know this question is quite old but I'm answering as I recently had this issue. I was trying to export 2 million + rows and it had taken 2 days to only complete half. This was after trying several different ways of export. Then found this:

SELECT * 
FROM my_table
INTO OUTFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/my file.csv' 
FIELDS ENCLOSED BY '"' 
TERMINATED BY ';' 
ESCAPED BY '"' 
LINES TERMINATED BY '\r\n';

And it completed in 80 seconds!

Please note: if you hit secure_file_priv issue then set the file path to be equal to the result of:

SHOW VARIABLES LIKE "secure_file_priv"
like image 110
Laura Baker Avatar answered Sep 17 '22 06:09

Laura Baker