Knowledgebase

MySQL data recovery

Posted by snakev, 09-10-2010, 09:15 PM
Hello, One of my drives have failed and now all my database is gone, i will hire a data recovery service, but my question is , if i get a copy of the /var/lib/mysql/ folder complete, and i paste it to a new server with same MySQL version, it will work and all databases and tables would be recognized in MySQL? Databases storage are InnoDB but some of them are MyISAM tables. Thank you

Posted by Steven, 09-10-2010, 09:26 PM
It may be possible, innodb is picky sometimes and is sensitive to corruption

Posted by InstaCarma_Support, 09-11-2010, 01:34 AM
Which data recovery software are you using ? Is it RsoftCDP ?

Posted by Hillockhosting, 09-11-2010, 02:14 AM
Just copying would not be sufficient. The table structure would get effected. Would suggest use some recovery tool.

Posted by mugo, 09-11-2010, 04:37 AM
You may get lucky, it heavily depends on your implementation, usage, and config of your mysqld. But learn, if nothing else, do a mysqldump and copy that crap off somewhere else on a schedule, and you won't find yourself in this boat again!

Posted by matt2kjones, 09-11-2010, 05:20 AM
Copying the data files back into the /var/lib/mysql folder may or may not work, and here is why: Some table data may have been cached in ram and not written to disk when you made the copy. The data files may have been written to as you copied it. If you shutdown sql server properly, made a copy of the files to another /var/lib/mysql folder, then started it on that machine, then it should be fine. You should look at mysqlhotcopy.... It does exactly this. It locks the database tables..... flushes data to disk, copies the files to a location..... then unlocks the table.... perfect for making backups of servers in production... and much quicker than other techniques..... It is then safe to move those files to another mysql data dir

Posted by madaboutlinux, 09-11-2010, 08:25 AM
MyISAM tables should not be a problem if you copy them as it is on the new server but I doubt InnoDB will work. It also depends on what is crashed and to what extent it has affected the drive. If the complete data under /var/lib/mysql directory is safe, tables of both storage engines should work.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Yum/Munin Issue (Views: 592)


Language:

Client Login

Email

Password

Remember Me

Search