Home | Mirror | Search |
mysqldump -uroot -p dbname | gzip > dbname.backup
-t, --no-create-info Don't write table creation info.
mysqldump -uroot -p -t -d database
-c, --complete-insert Use complete insert statements.
$ mysqldump -hlocalhost -uroot -t neo test INSERT INTO `test` VALUES (98,'neo','chen'),(112,'jam','zheng'),(113,'john','meng'); $ mysqldump -hlocalhost -uroot -c -t neo test INSERT INTO `test` (`userid`, `username`, `password`) VALUES (98,'neo','chen'),(112,'jam','zheng'),(113,'john','meng');
--extended-insert 預設開啟
INSERT INTO `test` VALUES (98,'neo','chen'),(112,'jam','zheng'),(113,'john','meng');
每條記錄使用一次insert
$ mysqldump -hlocalhost -uroot --skip-extended-insert -t neo test |more INSERT INTO `test` VALUES (98,'neo','chen'); INSERT INTO `test` VALUES (111,'neo','chen'); INSERT INTO `test` VALUES (112,'jam','zheng'); INSERT INTO `test` VALUES (113,'john','meng');