1, Login to mysql terminal:
c@cm-test:~$ mysql -u xxxxxx -pxxxxxxx mydatabase
2, run:
mysql> select * into OUTFILE 'abc.CSV' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM excel_unique;
3, the file should be in
/mydisk/lib/mysql/mydatabase/abc.CSV
Subscribe to:
Post Comments (Atom)
-
Step 1, New a project rails new demo Step 2, Update Gemfile add paperclip, mysql2 gem, enable JavaScript runtime gem 'mysql2' ...
-
I used 7z to zip this file under Windows, try to unzip it under linux [ang@walker temp]$ gunzip 2011.sdf.zip gunzip: 2011.sdf.zip: unkno...
-
When trying to access transmission from web-browswer i got the message : 403: Forbidden Unauthorized IP Address. Either disable the IP ad...
SELECT Email INTO OUTFILE '/tmp/contact.CSV' FIELDS TERMINATED BY ','
ReplyDeleteOPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
FROM `all_suppliers` WHERE email !='';
SELECT DISTINCT(Email) INTO OUTFILE '/tmp/contact.CSV' LINES TERMINATED BY '\n'
ReplyDeleteFROM `all_suppliers` WHERE email !='';