Selecting a table from a mysqldump file

From MyWiki
Revision as of 15:43, 10 June 2015 by George2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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