Link to home
Start Free TrialLog in
Avatar of lee88
lee88Flag for United States of America

asked on

Move MySQL data?

I have been asked to repair a MySQLServer instance. My understanding is that the associated executables are on the Windows XP C: drive, but the data was on the E: drive. The E: drive failed. However, I have what I believe to be a backup copy of the data (a single file named "ibdata1"), which someone copied to a folder on the C: drive just before the E: drive failure. My questions are:
1.  Is it likely that the "ibdata1" file IS the SQL data? Does "ibdata1" sound like a default-name, and is a small SQL dataset stored in a single file?
2. Is there a way to see (edit) the configuration? I am hoping that I can just change a pointer to point to this data file. I found MySQLInstanceConfig.exe, but it prompts me saying it will over-write the current config. I would just like to view the current cofig (location of data).

Obviously, I have never worked with MySQL. Any help / suggestions sincerely appreciated.

Avatar of Umesh
Umesh
Flag of India image

1.  Is it likely that the "ibdata1" file IS the SQL data? Does "ibdata1" sound like a default-name, and is a small SQL dataset stored in a single file?

>>  that's Innodb data file but you need innodb log file (ib_logfile0 and ib_logfile1) & all the /databasename/*.frm files in order to restore.. only datafile is not enough..  may be you can try something which is suggested here

http://forums.mysql.com/read.php?156,163884,165472#msg-165472

and go thru reply from Marko Mäkelä (http://forums.mysql.com/read.php?156,163884,165472#msg-165472)

2. Is there a way to see (edit) the configuration? I am hoping that I can just change a pointer to point to this data file. I found MySQLInstanceConfig.exe, but it prompts me saying it will over-write the current config. I would just like to view the current cofig (location of data).

Pls don't try this with innodb data file.. you would end-up corrupting the file
Avatar of lee88

ASKER

Thanks for the response.

I found the ib_logfile0 and ib_logfile1 files located on the good C: drive in this folder:
 - C:\Program Files\MySQL\MySQL Server 5.0\data
The ib_logfile0 file is dated 02-06-2009 which is 4 days after the last new data was added.
The ib_logfile1 file is dated 12-01-2006 which is probably when MySQL was installed?

I also found /databasename/*.frm (and other files) located in this folder:
 - C:\Program Files\MySQL\MySQL Server 5.0\KioskActivity
which I do think is the active application folder. (Not sure why the ibdata1 file was on the failed E: drive).
The newest file in this folder is dated 02-02-2009 which is when the last new data was added.

With the above info, can I somehow tell MySQL how to find my newly-relocated ibdata1 file?
ASKER CERTIFIED SOLUTION
Avatar of Umesh
Umesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lee88

ASKER

Excellent. Thank you.