MySQL SOURCE command for importing large SQL files

MySQL SOURCE command for importing large SQL files

If you have a large database that you frequently dump and rebuild, you might want to consider using the mysql SOURCE command. In the past, with smaller databases, I have imported using the following method:

mysql -u root -p monkseal_development < monkseal_development.sql

However, if monkseal_development.sql is large, there’s a way to speed this up.

mysql --max_allowed_packet=128M -u root -p monkseal_development
....

mysql> SOURCE monkseal_development.sql

Read More