Selecting a table from a mysqldump file

From MyWiki
Jump to: navigation, search

sed -n -e '/DROP TABLE.*mytable/,/UNLOCK TABLES/p' mydump.sql > tabledump.sql

sed -n -e '/CREATE TABLE.*mytable/,/CREATE TABLE/p' mysql.dump > mytable.dump

Reference : http://stackoverflow.com/questions/1013852/can-i-restore-a-single-table-from-a-full-mysql-mysqldump-file