speed mysql import code example
Example 1: faster mysql imports
#Innodb before import:
SET FOREIGN_KEY_CHECKS = 0;
SET UNIQUE_CHECKS = 0;
SET AUTOCOMMIT = 0;
#After import:
SET UNIQUE_CHECKS = 1;
SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
Example 2: faster mysql imports
#To disable MySQL indexes:
ALTER TABLE `table_name` DISABLE KEYS;
#To enable MySQL indexes:
ALTER TABLE `table_name` ENABLE KEYS;