The best I mean the smallest开发者_如何转开发 file size.
gzipped SQL is probably about the best you're going to get. You could copy the actual data files themselves, but then you run the risk of copying a partially modified table, resulting in a broken copy.
mysqldump -h host -u username --password=foo dbname > file.sql
gzip file.sql
mysqldump -h host -u username --password=foo dbname | gzip -9 > file.sql.gz
精彩评论