最快的转储方法是什么使用mysqldump加载MySQL InnoDB数据库? [英] What's the quickest way to dump & load a MySQL InnoDB database using mysqldump?
问题描述
我想使用mysqldump和MySQL 5.1创建一个数据库副本,其中包含大约40个InnoDB表和大约1.5GB的数据.
I would like to create a copy of a database with approximately 40 InnoDB tables and around 1.5GB of data with mysqldump and MySQL 5.1.
什么是最好的参数(即--single-transaction),它们将导致最快的数据转储和加载?
What are the best parameters (ie: --single-transaction) that will result in the quickest dump and load of the data?
同样,在将数据加载到第二个DB中时,是否更快:
As well, when loading the data into the second DB, is it quicker to:
1)将结果直接通过管道传递到第二个MySQL服务器实例,并使用--compress选项
1) pipe the results directly to the second MySQL server instance and use the --compress option
或
2)从文本文件中加载它(即:mysql< my_sql_dump.sql)
2) load it from a text file (ie: mysql < my_sql_dump.sql)
推荐答案
将其直接放置到另一个实例中,以避免磁盘开销.除非您在慢速的网络上运行,否则不要打扰--compress
,因为在快速的LAN或环回中,网络开销无关紧要.
Pipe it directly to another instance, to avoid disk overhead. Don't bother with --compress
unless you're running over a slow network, since on a fast LAN or loopback the network overhead doesn't matter.
这篇关于最快的转储方法是什么使用mysqldump加载MySQL InnoDB数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!