Monthly Archives: August 2012

MySQL: How to Restore Specific Tables From a Large SQL Dump File

So I’ve ran into an emergency case where I had to restore a single table from a 40GB backup created with mysqldump (A logical backup). ┬áRestoring the whole thing would take more than two hours! Let’s use “table1” as the table I need to restore into “database1” from a mylargedump.sql dump file.

grep 'INSERT INTO <code>table1’ mylargedump.sql | mysql database1

That’s it! The insert statements for this specific table will pipe directly into MySQL.