Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
PLease add the error that occurs. –  c0dev Oct 31 '13 at 8:37

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.