I have a mysqldump backup of my mysql database consisting of all of our tables which is about 440 megs. I want to restore the contents of just one of the tables from the mysqldump. Is this possible? Theoretically, I could just cut out the section that rebuilds the table I want but I don't even know how to effectively edit a text document that size.
Mysql – restore a single table from a full thesql thesqldump file
backupMySQLrestore
Related Topic
- Mysql – How to restore thesql database
- Postgresql – Restore a postgres backup file using the command line
- Mysql – How to reliably restore MySQL blobs
- Mysql – Insert into a MySQL table or update if exists
- Mysql – How to take backup of a single table in a MySQL database
- Mysql – How to import an SQL file using the command line in MySQL
Best Answer
You can try to use sed in order to extract only the table you want.
Let say the name of your table is
mytable
and the filemysql.dump
is the file containing your huge dump:This will copy in the file
mytable.dump
what is located betweenCREATE TABLE mytable
and the nextCREATE TABLE
corresponding to the next table.You can then adjust the file
mytable.dump
which contains the structure of the tablemytable
, and the data (a list ofINSERT
).