how to store the mysql query result into a local csv file ?
edit 2 :
because i dont have access in the remote machine .
how to store the mysql query result into a local csv file ?
edit 2 :
because i dont have access in the remote machine .
You can try doing :
SELECT a,b,c
FROM table_name
INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
We use the OUTFILE clause here to store the output into a CSV file.
We enclose the fields in double-quotes to handle field values that have the comma in them and we separate the fields by comma and separate individual line using newline.