On 2012-06-09, Miguel Cardenas <renit...@gmail.com> wrote:
>
> My linux system died due a bad system driver and it does not boot
> ANYMORE, I am backing up my data files to restore a previous worlking
> backup of the whole system that DOES NOT INCLUDE THE DATABASES...

I hope you will be correcting that in the future!

> I'm still backing up and will take some time before restore the
> system, in the mean time I want to know if I can restore the databases
> from the *.frm *.MYD and *.MYI files, maybe creating the databases
> again and replace them with the old data files?

If they are MyISAM tables, then you should be able to restore most of
your tables in this fashion.  It depends on how often these tables are
written to; if they get writes very frequently then they may be too
inconsistent to recover.  The basic process is to create the directory
(either with CREATE DATABASE or directly on the filesystem; make sure
the mysql user can write the directory), then copy the files in to the
directory (make sure nobody is doing any writes to the db during this
process, and make sure the files are owned by the mysql user when done).

This is basically how mysqlhotcopy works--it locks the tables, then
copies the raw files to the destination.  Your only potential problem is
that the tables were open at the time, so changes might not have been
written before your crash.

Once you have copied the needed files, you should run myisamchk (make
sure mysqld is *not* running) on the *.MYI files.

--keith

-- 
kkel...@wombat.san-francisco.ca.us



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to