Link to home
Start Free TrialLog in
Avatar of Brogrim
BrogrimFlag for Ireland

asked on

Select * into OUTFILE

I ma connected to the MySQL Server by a trusted connection on  a remote PC using work bench

I am using the Select *  into OUTFILE statement

Select * 
into OUTFILE 'C:\\testexport1.xls'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
from tblmemberdraw_recipients;

Open in new window


This is working but is exporting the file to the server instead of my PC, how do I get the file to be exported to my PC instead of the server.
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brogrim

ASKER

Tomas

Does the -e mean echo in a command prompt?

I use workbench for all operations, does the above mean using the command prompt?

Thanks
Hi!

This was a command prompt example where -e stands for excecute and following is your query in "" brackets.
If you use MYSQL workbench you can execute your sql in a query tab where the
result is shown in a Result-tab which you then can export into file of your choice.


Regards,
    Tomas Helgi
Avatar of Brogrim

ASKER

OK, was hoping to be automate the complete procedure within Workbench but as you explained not possible without command prompt.

Thanks