Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a user that is using workbench to connect to a Linux MySQL Server and would like to have the query results sent straight to a csv or text file on his computer. I know how to do it if I were on the Linux box, but not from workbench. I know you can get your results i workbench and export them, but I'd like to save the step. One of the problems is his result set is really large and workbench sometimes has memory errors.

share|improve this question

migrated from stackoverflow.com Oct 5 '12 at 17:49

This question came from our site for professional and enthusiast programmers.

2 Answers 2

I'm not sure about Workbench but could you use a simple proxy on the local machine.

When the result comes back just get the proxy to output to text/csv file and then relay it back to Workbench if you want.

Just a thought but would probably only worthwhile if the memory issue was going to be an ongoing problem.

share|improve this answer
    
I'm not sure how to apply a "simple proxy" on the local machine? We are tunneling using ssh. –  Jeff Sep 7 '12 at 17:52

select ... into outfile '<path>/file.csv' should work. According to this link you will need to give the user 'FILE' privilege. And ofcourse you need write permissions to the location where you are trying to create the file.

About the memory issue, maybe use the command line instead of Workbench?

share|improve this answer
    
That only works if you are connected to a local MySQL server. I am tunneling using ssh from a windows PC to a linux server. –  Jeff Sep 7 '12 at 17:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.