Shakeel
Shakeel

Reputation: 11

MYSQl dump single table from huge file

How do I dump single table data from a huge dump file into the database.

Upvotes: 1

Views: 7659

Answers (2)

James C
James C

Reputation: 14159

There are some suggestions on how you might do this in the following articles:

I found these by searching for "load single table from mysql database dump" on Google: http://www.google.com/search?q=load+single+table+from+mysql=database+dump

Upvotes: 2

Galz
Galz

Reputation: 6842

If I understand your question correctly - you already have a dump file of many tables and you only need the restore one table (right?).

I think the only way to do that is to actually restore the whole file into a new DB, then copy the data from the new DB to the existing one, OR dump only the table you just restored from the new DB using:

mysqldump -u username -p db_name table_name > dump.sql

And restore it again wherever you need it.

To make things a little quicker and save some disk, you can kill the first restore operation after the desired table was completely restored, so I hope the table name begins with one of the first letters of the alphabet :)

Upvotes: 8

Related Questions