Home  >  Article  >  Database  >  MySQL数据库删除后的恢复工作_MySQL

MySQL数据库删除后的恢复工作_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:261042browse

            上午不小心把昨天刚刚建好的一个数据库删了个精光!幸好mysql中开启了日志功能。

            下面总结一下数据库删除后的恢复方法:

             首先:将最近的二进制类型的日志文件存成文本文件导出,命令如下:

               mysqlbinlog  F:/wamp/mysql-bin.000045  > F:/test.txt

             其次:打开保存的txt文件,文件格式如下:

              

            其中at 1099代表第1099个命令(姑且这么记),查询这些命令,看看你需要回复的命令在什么地方,然后执行 命令。

          最后:执行回复命令,如下:

                mysqlbinlog   --start-position="123"  --stop-position="531"   F:/wamp/mysql-bin.000045  F:/test.txt | mysql -uroot -p

        这样就可以完成数据库的回复了!!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn