Solved

Retrieve lost data MyISAM table mysql how-to

Posted on 2008-10-24
8
680 Views
Last Modified: 2013-12-13
Hi!
 i lost 99% of all my data from 2 tables of my database.

I ran a myisamchk and push the info to a txt file. I got this:
Data records:       1   Deleted blocks:     252
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check record links


I need to retrieve the deleted blocks since it shouldn`t have been deleted and don`t know why it is in deleted blocks.

Any idea what should i do?
0
Comment
Question by:PUB_UL
  • 3
  • 3
8 Comments
 
LVL 13

Assisted Solution

by:Xyptilon2
Xyptilon2 earned 150 total points
ID: 22797463
Have you done a

myisamchk -o table ? or a
myisamchk -r table?

This should be able to recover data

0
 
LVL 1

Author Comment

by:PUB_UL
ID: 22797685
Both of these commands doesn`t work.

Actually, it looks like i would have done a DELETE command, since my rows seems to appear in the Deleted blocks. An optimize table clear DELETED BLOCKS to make more space... but what i want is to retrieve data that would have been deleted earlier... but the thing is, we didn`t do such command.

Also, when running myisamchk, i don`t get any info telling me it is a corrupted table.

Any other idea?
0
 
LVL 26

Assisted Solution

by:ushastry
ushastry earned 350 total points
ID: 22798693
Last try would be...

Do you backup your data? If you have a  latest backup then you can restore.. you may end up losing couple of hours data...

For point in time recovery...
Is binary logging enabled???? If so then you may give try like this..

Pls do the change as required..

mysqlbinlog --database=db_name --start-date="2008-10-23 9:00:00" \
      --stop-date="2008-10-24 10:05:00" \
      /var/log/mysql/bin.xxxxxx \
   > /tmp/mysql_restore.sql

0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 26

Expert Comment

by:ushastry
ID: 22916006
Any updates on this?
0
 
LVL 1

Author Comment

by:PUB_UL
ID: 22922905
I didn`t have a backup that is why i needed to try to restore those blocks.

I haven`t been able to retrieve them so far and now i am making backup since i lost alot of data from those 2 tables.
0
 
LVL 26

Accepted Solution

by:
ushastry earned 350 total points
ID: 22922965
Is binary logging is enabled ?
I just want to know whether you tried the the thing which I suggested..  
If tried and getting any errors then let me know.
0
 
LVL 1

Author Closing Comment

by:PUB_UL
ID: 31509661
It didnt solve my problem, i haven`t found anything that could fix it, but thanks for your time...
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now