472,145 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Moving databases from one hard drive to another ?

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
3 4364
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

"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
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.

Similar topics

6 posts views Thread by Hemant Shah | last post: by
2 posts views Thread by Massimiliano Campagnoli | last post: by
6 posts views Thread by Woody Splawn | last post: by
2 posts views Thread by Todd Beauchemin | last post: by
3 posts views Thread by LurfysMa | last post: by
2 posts views Thread by DataPro | last post: by
3 posts views Thread by scoots987 | last post: by
15 posts views Thread by mcjason | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.