Mysql 按行dump出数据

mysqldump -u${user} -p${passwd} --skip-extended-insert --database ${dbname} --table ${tablename} > ${tablename}.sql

用以上语句导出的sql文件中,每条数据都按照一个INSERT语句来保存,方便用版本比较工具按行比较数据差异

例如

INSERT INTO `goods` VALUES (2,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,1467019659,0,'');
INSERT INTO `goods` VALUES (4,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,1467019659,0,'');
INSERT INTO `goods` VALUES (7,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,1467019659,0,'');
INSERT INTO `goods` VALUES (8,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,1467019659,0,'');

 

posted @ 2016-06-27 17:39  你好阿汤哥  Views(879)  Comments(0Edit  收藏  举报