By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,486 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Moving databases from one hard drive to another ?

P: n/a
Hi All,
I have a hard drive that fails to boot with some mysql 4.1 data I would like
to keep.
Have slaved that drive to another PC (with mysql 4.1.12 loaded) and have
saved other data and am able to access its MYSQL folder ...

I tried to copy the data folder into corresponding directory on new drive
but when I try ot look at any of the databases I get errors like:

#1017 - Can't find file: 'master_name.MYI' (errno: 2)

... I look for corresponding .MYI files but cant find any on the old drive.

Have I lost my database files or is there another way of porting the
database to the new drive.

I'd greatlt apprecaite if anyone can point me in correct direction.

Regards

Paul
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rock2005 wrote:
#1017 - Can't find file: 'master_name.MYI' (errno: 2)

... I look for corresponding .MYI files but cant find any on the old drive.

Have I lost my database files or is there another way of porting the
database to the new drive.


Try running following queries:
CHECK TABLE tablename;
http://dev.mysql.com/doc/mysql/en/check-table.html

REPAIR TABLE tablename;
http://dev.mysql.com/doc/mysql/en/repair-table.html

Also see this from the link above:
"As of MySQL 4.0.2, there is a USE_FRM mode for REPAIR TABLE. Use it if
the .MYI index file is missing or if its header is corrupted. In this
mode, MySQL re-creates the .MYI file using information from the .frm file."
And next time, be sure to create backups from your important data.
Jul 23 '05 #2

P: n/a

"Aggro" <sp**********@yahoo.com> wrote in message
news:mA**************@read3.inet.fi...
Rock2005 wrote:
#1017 - Can't find file: 'master_name.MYI' (errno: 2)

... I look for corresponding .MYI files but cant find any on the old
drive.

Have I lost my database files or is there another way of porting the
database to the new drive.


Try running following queries:
CHECK TABLE tablename;
http://dev.mysql.com/doc/mysql/en/check-table.html

REPAIR TABLE tablename;
http://dev.mysql.com/doc/mysql/en/repair-table.html

Also see this from the link above:
"As of MySQL 4.0.2, there is a USE_FRM mode for REPAIR TABLE. Use it if
the .MYI index file is missing or if its header is corrupted. In this
mode, MySQL re-creates the .MYI file using information from the .frm
file."
And next time, be sure to create backups from your important data.


Thanks for the pointer Aggro ... I tried Repair table with USE_FRM and still
get same reapair error.

eg. REPAIR TABLE address USE_FRM
addressbook.address repair error Can't find file: 'address.MYI' (errno: 2)

Unfortunately the backups were all on another partition which are unreadable
.... I will CD backup next time :(

I wonder is ther a way to run the backup utility on on the old drive to
retreive the databases ....
Jul 23 '05 #3

P: n/a
Rock2005 wrote:
Thanks for the pointer Aggro ... I tried Repair table with USE_FRM and still
get same reapair error.
Did you run check first? I'm not sure if it is needed, but better run it
first to play safe.
eg. REPAIR TABLE address USE_FRM
addressbook.address repair error Can't find file: 'address.MYI' (errno: 2)
Just guessing now, but you could try to create the file (and make sure
if got same user permissions as the other files in the database folder).
Then it should at least give a different error.

If everything else fails, you should still be able to retrieve the data
manually from the MYD file, which can be slow, but at least possible.
But I'm pretty certain that you should be able to recover the database
if your MYD-file and FRM-file.
Unfortunately the backups were all on another partition which are unreadable
... I will CD backup next time :(


It is surprising how many people think that backups on a same hard drive
are a good idea. When I had really important data, I created backups on
two different homecomputers + 2 computer in same city, but different
parts of it + 1 backup on a computer that was on a different country (or
could been on different continent also).

I've been trying to tell to many people to take care of the backups.
Only way they seem to bulieve is by learning it from experience. It is
sad. But let's hope you can retrieve the data.
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.