Speeding up MySQL imports from mysqldmp

If you need to import a very large SQL dump file to MySQL, the following should speed things up considerably:

At the begining of the SQL dump file, add:

SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;

and at the end:

COMMIT;

Then proceed as usual with the import, i.e

mysql> source myfile.sql

Leave a Reply

Your email address will not be published. Required fields are marked *