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' ...
-
Disk is out of space [root@reyotest stat]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 231825...
-
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 !='';