Page 1 of 1

URGENT - Porteus RESCUE MySQL Backup

Posted: 16 Feb 2012, 22:36
by nikoc1337
Hi. Im running a dedicated server with centos 5 64bit, and it got shutted down and it is not booting. I have mounted my disk but i don't know how can i get a backup of sql databases.

Re: URGENT - Porteus RESCUE MySQL Backup

Posted: 16 Feb 2012, 22:43
by fanthom
not sure about CentOS but gentoo stores mysql db in /var/lib/mysql folder (if i'm not mistaken - played with mysql some time ago).
i would do a backup of whole /var folder so maybe you'll be able to read some log files and find the reason of the crash :wink:

Re: URGENT - Porteus RESCUE MySQL Backup

Posted: 16 Feb 2012, 22:57
by nikoc1337
Yea, there are some files there but i need to take a backup of the database

Re: URGENT - Porteus RESCUE MySQL Backup

Posted: 17 Feb 2012, 03:43
by brokenman
First thing is to create a non destructive image of the /var folder on a separate drive using something like partimage. Then you could attach the bad drive to anther centos machine and configure the sql database to point to the bad drive and do a mysqldump.

Personally i would wait for Hamza to answer this one .... he has learned alot about database problems. :sorry:

Re: URGENT - Porteus RESCUE MySQL Backup

Posted: 17 Feb 2012, 08:18
by Hamza
It is very difficult as the database are stored as binary file into /var. The thing you need to do is to make a snapshot of files present on /var and try to go in /var/lib/mysql. This folder should contains some binaries files which it contains also your database data. If you want really to restore your databases data.

After be in /var/lib/mysql. You should find out a folder named data and another one inside it named like your old database name.

The easy method would be to use brokenman's method.

The database files are there : /var/lib/mysql/data/your_database

What is your type of table ? InnoDB, MyISAM, etc ??

A method on fly :
  1. Install centOS on new server
  2. Copy/mount your old var folder on new server as /var
  3. Open a terminal and run mysqldump your_database
If your data are not sensible and be read by someone else than you. Please make a zip of /var/lib/mysql and upload it somewhere and post the link or send me the link via PM.