简体   繁体   中英

How to recover data from MySql Data files?

One of my servers' OS crashed yesterday. It was Win 2008.The server developed an HDD fault and did not boot.

My host provider (Turnkey) has mounted the HDD on a Rescue system and given me access to the HDD through SSH. I have been able to download the Mysql data folder and all the MYD, MYI, FRM files. (MyIsam db?).

I tried changing my local computer's data folder to the backup data folder but MySql didn't run with this data folder. At my other server the db showed up but it was empty!

I believe this could be happening due to version differences in the MySql files.

Is there any way I can recover this data? A tool maybe, or a way?

Also

  • How can I find the version of mysql from the data files or the bin folder.

Thanks for the help guys!

Copy the folders of data files (MYD, etc) to your local data directory but skip the 'mysql' folder (too version specific and might not be right for the local setup). Compare the directory structure to your local files to make certain that they're in the right place. On linux, I would check the file ownership and permissions but don't know how important this is on Windows.

Restarting your local mysqld should recognize the new database(s). I'll presume that you're running with full DB permissions for this. If they show up, use check table . If they don't, run myisamchk externally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM