周梦康 发表于 2015-04-03 2346 次浏览 标签 : Mysql
mysqldump -uroot site icon_replace --where="1 limit 10000" > /tmp/zmk.log

输出csv文件 http://www.tech-recipes.com/rx/1475/save-mysql-query-results-into-a-text-or-csv-file/

SELECT order_id,product_name,qty FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'

修改插入的时候的如果遇到主键冲突忽略:

update ignore table_xxx set xxx where xxx
INSERT IGNORE INTO books (name) VALUES ('MySQL Manual')

评论列表