List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:May 21 2010 5:12pm
Subject:Re: Recover accidentally deleted MySQL database files
View as plain text  
And this is why you have backups :-)

You have little guarantee that the recovered blocks form complete files, but
you can try to move them into the directory (with the correct mdi, myd and
frm extensions and named consistently, of course) and try to figure out what
contains which data from the contents of the tables.

The first challenge, however, is going to be matching the correct .frm file
to the correct .myd and .mdi. I guess you could skip the .mdi files, as
they're just indices, that'll make the job slightly easier at least.

Keep the originally recovered files, too, just in case MySQL tries to write
to some of them and corrupts them.

I hope you enjoy puzzles...



On Fri, May 21, 2010 at 6:48 PM, Jose Luis Marin Perez <
jmarin@stripped> wrote:

> thanks for your answer, it seems these files were deleted when running
> fsck.
>
> In the /Lost+found directory files are referenced to Mysql for example:
>
> #114470: MySQL table definition file Version 9
> #114471: MySQL MISAM compressed data file Version 1
> #114472: DBase 3 data file (256 records)
> #114473: MySQL table definition file Version 9
> #114474: MySQL MISAM compressed data file Version 1
> #114475: DBase 3 data file (258 records)
> #114476: MySQL table definition file Version 9
> #114477: MySQL MISAM compressed data file Version 1
> #114478: DBase 3 data file (33489404 records)
> #114479: MySQL table definition file Version 9
> #114480: MySQL MISAM compressed data file Version 1
> #114482: MySQL table definition file Version 9
> #114483: MySQL MISAM compressed data file Version 1
> #114484: DBase 3 data file (256 records)
> #114485: MySQL table definition file Version 9
> #114486: MySQL MISAM compressed data file Version 1
> #114487: DBase 3 data file (8960 records)
> #114488: MySQL table definition file Version 9
> #114489: MySQL MISAM compressed data file Version 1
> #114490: DBase 3 data file (256 records)
>
> There any way to recover these files in its original location?
>
> Thanks
>
> Jose Luis
>
> -----Mensaje original-----
> De: mos [mailto:mos99@stripped]
> Enviado el: Viernes, 21 de Mayo de 2010 11:24 a.m.
> Para: mysql@stripped
> Asunto: Re: Recover accidentally deleted MySQL database files
>
> At 10:42 AM 5/21/2010, you wrote:
> >Dear sirs,
> >
> >
> >
> >Accidentally files in a database have been deleted (/ var/lib/mysql
> >/"database") when entering the mysql console shows that the database is
> >created but does not show any table, there is some method to recever the
> >information in this database?
> >
> >
>
> You need to restore your database data directory from backup. You could try
> to undelete the files in the data directory but that may not recover all of
> the data since the tables may have been open when the files were erased.
>
> Before restoring the files from your backup, make sure you either flush the
> tables or shutdown the mysql server.
>
> Mike
>
>
> >Centos 4.6
> >
> >mysql  Ver 14.7 Distrib 4.1.20, for redhat-linux-gnu (i686) using readline
> >4.3
> >
> >
> >
> >Thanks
> >
> >
> >
> >Jose Luis
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

Thread
Recover accidentally deleted MySQL database filesJose Luis Marin Perez21 May
  • Re: Recover accidentally deleted MySQL database filesmos21 May
    • RE: Recover accidentally deleted MySQL database filesJose Luis Marin Perez21 May
      • Re: Recover accidentally deleted MySQL database filesJohan De Meersman21 May