I've got a moderate size MySQL database with about 30 tables, some of which are 10 million records, some 100 million. The mysqldump
of all the tables (into separate files) is fairly fast, takes maybe 20 minutes. It generates about 15GB of data. The largest dumped files are in the 2GB range.
When I load the data into MySQL on another box, a six-core, 8GB machine, it takes forever. Easily 12 clock hours or more.
I'm just running the mysql client to load the file, i.e.
mysql database < footable.sql
directly with the file directly out of mysqldump
mysqldump database foo > footable.sql
Clearly I am doing something wrong. Where do I start so it can finish in a reasonable time?
I'm not using any switches on either the dump or the load.
Best Answer
Take these some points in your consideration they may help you in case of generating the dump and restoring it.
Extended inserts
in dumps.--tab
format so you can usemysqlimport
, which is faster thanmysql < dumpfile
.innodb_flush_log_at_trx_commit = 2
in your my.cnf, temporarily while the import is running. you can put it back to 1 if you need ACIDGive it a try..