Avatar of Brogrim
Brogrim
Flag 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.
MySQL Server

Avatar of undefined
Last Comment
Brogrim

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Tomas Helgi Johannsson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
Tomas Helgi Johannsson

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
Brogrim

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

Thanks
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes