开发者

MYSQl dump single table from huge file

开发者 https://www.devze.com 2023-02-28 17:52 出处:网络
How do I dump single table dat开发者_开发问答a from a huge dump file into the database.If I understand your question correctly - you already have a dump file of many tables and you only need the resto

How do I dump single table dat开发者_开发问答a from a huge dump file into the database.


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 :)


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

  • http://blog.tsheets.com/2008/tips-tricks/mysql-restoring-a-single-table-from-a-huge-mysqldump-file.html
  • http://blog.tsheets.com/2008/tips-tricks/extract-a-single-table-from-a-mysqldump-file.html

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

0

精彩评论

暂无评论...
验证码 换一张
取 消