HELLO, I’M SERHAT AND THIS IS MY FANCY TITLE.

Import huge databases faster in mysql


Recently I needed to import very huge SQL dumps to my local machine. There were 10 different .sql files dumped from Moodle and each of them were sized more than 10GB with approximately 5 million rows. First of all, I tried to import them in a traditional way by using:

mysql -u username -p some_db < database1.sql

However each import request took a very long time, approximately 6-7 hours for each .SQL file. Please also you consider that I conducted this operation in a brand new laptop with Intel i7 CPU, 16GB RAM and 512GB SSD disk. Since I didn't have 60 hours for importing all these dump files, I took a look for potential solutions and found a very effective one.

Continue reading
Date: | Tags: mysql, import big database, import huge database, innodb settings | Categories: tech, database