1

I've typed the following code to output the csv file , but it shows an error

mysql> SELECT *INFO OUTFILE 'd:/student.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' FROM tbl_student;

does anybody know what's wrong here?

1
  • PLease add the error that occurs.
    – Christian
    Oct 31, 2013 at 8:37

1 Answer 1

0
SELECT *INFO
FROM tbl_student
INTO OUTFILE 'd:/student.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'

Keep in mind that the output file must not already exist and that the user MySQL is running as has write permissions to the directory MySQL is attempting to write the file to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .