2010-03-09 88 views

回答

1

您将需要创建表中恢复-db和运行类似:

grep "^INSERT INTO table" dump-file | mysql -u user -p restore-db 

首先确保你的模式正确匹配。

+0

啊,好主意..谢谢马丁。 – Ian 2010-03-10 14:23:54

1
cat THE_DUMP_FILE.SQL | sed -n "/^-- Table structure for table \`THE_TABLE_NAME\`/,/^-- Table structure for table/p" > THE_OUTPUT_SQL_FILE_NAME 

我用Google搜索周围在这个同时,该解决方案为我工作很好,并且似乎是一个大的转储文件的速度最快的解决方案之一,我得到了这个想法: http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump

相关问题