日期:2014-05-16 浏览次数:20798 次
mysqldump -h127.0.0.1 -P3306 -uroot -ppassword --add-locks -q dbname > dbname.sql
LOCK TABLES `user` WRITE; DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL DEFAULT '', ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; INSERT INTO `user` VALUES ('1', 'name1'); INSERT INTO `user` VALUES ('2', 'name2'); UNLOCK TABLES;
mysqldump -h127.0.0.1 -P3306 -uroot -ppassword --add-locks -q -d dbname > dbname.sql
LOCK TABLES `user` WRITE; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL DEFAULT '', ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; UNLOCK TABLES;
mysqldump -h127.0.0.1 -P3306 -uroot -ppassword --add-locks -q -t dbname.user > dbname.sql
LOCK TABLES `user` WRITE; INSERT INTO `user` VALUES ('1', 'name1'); INSERT INTO `user` VALUES ('2', 'name2'); UNLOCK TABLES;