Monday, February 28, 2011
Thursday, February 10, 2011
Mysql
To dump data from mysql table to txt file:
mysqldump --no-create-info --extended-insert=FALSE --compact psydex_rss_twitter MESSAGES > /tmp/testinsert.sql
(--extended-insert makes every row it's own insert statement)
SELECT col1,col2,col3
INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_here
WHERE col1 > 857461
LOAD DATA LOCAL INFILE '/tmp/file.csv'
INTO TABLE table_here
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
mysqldump --no-create-info --extended-insert=FALSE --compact psydex_rss_twitter MESSAGES > /tmp/testinsert.sql
(--extended-insert makes every row it's own insert statement)
SELECT col1,col2,col3
INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_here
WHERE col1 > 857461
LOAD DATA LOCAL INFILE '/tmp/file.csv'
INTO TABLE table_here
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Subscribe to:
Posts (Atom)