importing large dumps in MySQL
Last week I have to import a large (above 4 GB) MySQL dump, wich includes InnoDB tables. The dump was made with –extended-insert=false, so we have many single operations to do. It takes me above 50 hours (sic !) by doing a simple source datadump.sql in the MySQL console. Load on the machine was near 1,02.
Next time I will do it like that:
create database DATABASE charset=CHARSET;
use DATABASE;
set names CHARSET;
set FOREIGN_KEY_CHECKS=0;
set AUTOCOMMIT=0;
source datadump.sql;
COMMIT;
While inserting data with above example, the load skips up to 4,90 – 5,30, so the 2-core machine was not boring.
It is realy fast :)