简体   繁体   English

如何从MySQL转储文件恢复特定的数据库?

[英]How to recover a particular database from MySQL dump file?

I was having a website at a hosting while taking the backup I took the backup of whole mysql by mistake which includes databases of all my other websites also. 我在托管时在一个网站上进行备份时,我错误地对整个mysql进行了备份,其中包括我所有其他网站的数据库。

So now the problem is I want to extract that particular database from complete sql file? 所以现在的问题是我想从完整的sql文件中提取该特定数据库吗? Is there any procedure to do it or can we import that complete dump file into a mysql. 有什么程序可以做到吗,或者我们可以将完整的转储文件导入到mysql中。 So that later I can export that particular database after importing it to MySQL. 这样一来,以后可以在将特定数据库导入MySQL后导出该特定数据库。

Please help me or suggest me how to do it. 请帮助我或建议我该怎么做。

Thank You. 谢谢。

If the size of the schemas in your backup file that you do not want to restore are not that big and there aren't that many other schemas in there, your best bet would probably be to just restore the entire backup and then do a backup of just your schema. 如果你希望恢复备份文件中的架构的大小是没有那么大,有没有那么多的其他模式在那里,你最好的选择很可能是刚刚恢复整个备份,然后做一个备份只是您的架构。 One easy way to backup just your schema is to use MySQL Workbench . 一种仅备份模式的简单方法是使用MySQL Workbench If you run into problems getting setup or doing the backup you might want to check this little write up that walks you through installation and performing a backup. 如果您在设置或执行备份时遇到问题,则可能需要检查一下此小技巧,以引导您完成安装和执行备份。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM