Home  >  Article  >  Database  >  Can data deleted by navicat be restored?

Can data deleted by navicat be restored?

藏色散人
藏色散人Original
2019-08-15 13:39:0029973browse

Can the data deleted by navicat be restored?

The data deleted by navicat can be restored.

Can data deleted by navicat be restored?

Using navicat to delete the intrusive data in the database caused the deletion to go smoothly. Some important data that seemed to be duplicate data were directly deleted by right-clicking in the table (equivalent to delete from table command), and the database has not backed up these data, and the binary log has not been enabled. The conventional recovery method has completely reached a dead end.

In the process of solving the problem, I have made the following attempts:

1. I learned that if the log is enabled, just use mysqlbinlog to restore the log.

2. If instead of deleting part of the data in a table, you delete the entire table, you can use disk data recovery software to try to recover it immediately after deletion. (Because files will be deleted after deleting the table, but if part of the data in the table is deleted, the files still exist)

3. Find a data recovery company. The company claims that it can be restored using ibdata1, so I used tools to analyze it. ibdata1, check page by page to see if there is any historical record, and finally find that only existing data is stored in the page.

When using ibdata1 to restore data, you should try to restore it after understanding the structure of the data table. Except for ibdata1, other data in the database is damaged and cannot be used normally. It is not necessary to restore the data after deleting the table data. (In fact, this file stores existing table data. In fact, it can also be set to one file for each table.)

4. Finally, I found that there are two files ib_logfile0 and ib_logfile1 under mysql. In fact, these two files The file records some transaction logs of Mysql, which are used for rolling forward and rolling transactions. It is used by Mysql itself. After opening this file with a text tool, there are a lot of garbled characters, but you can find the insert of a small amount of deleted data. Records, a very small number of garbled characters were found through the previous and following statements to find the original text, and finally the deleted files were restored through the transaction log.

Related recommendations: "Navicat for mysql graphic tutorial"

Note: Using transaction log recovery requires several prerequisites.

1: Know the approximate location of the deleted data. Don’t search here while new data is constantly being inserted there.

2: Because there are a lot of garbled characters, it is suitable for finding a small amount of data, rather than for recovering a large amount of data, which is a waste of energy.

3: If the binary log is not turned on and there is no backup, this method can only be used to restore it.

The above is the detailed content of Can data deleted by navicat be restored?. For more information, please follow other related articles on the PHP Chinese website!

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