How to restore single table from large mysql dump ?

In this post I will briefly explain how to restore single table from a large mysql dump file. Its not that much hard what it says :)

BTW, first you need to know how to dump the database, so no worries ,some time back I wrote a blog post how to take a database dump. Take a look at this.

OK so lets get back to topic,
Here is the simple command that you can make it happen.

 sed -n -e '/CREATE TABLE.*mytable/,/CREATE TABLE/p' mydump.sql > table.sql  

mytable is the table name that you want to extract from the dump file.
mydump is the large dump file that contains dumped data
table is the file that will create after . (contains table creation data as well as insert data)
SO that's all. enjoy it :)

1 comment:

  1. Coin Casino 2021 – Play at Best Bitcoin Casino
    Coin Casino is a top-rated Bitcoin Casino カジノ シークレット that is operated by Direx N.V. and has been in operation since 2021. It holds licenses from the Curacao Gaming Authority 카지노사이트 and 인카지노