URGENT - Porteus RESCUE MySQL Backup

Non release banter
Post Reply
nikoc1337
Ronin
Ronin
Posts: 2
Joined: 16 Feb 2012, 22:34
Location: Athens

URGENT - Porteus RESCUE MySQL Backup

Post#1 by nikoc1337 » 16 Feb 2012, 22:36

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.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4614
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: URGENT - Porteus RESCUE MySQL Backup

Post#2 by fanthom » 16 Feb 2012, 22:43

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:
Please add [Solved] to your thread title if the solution was found.

nikoc1337
Ronin
Ronin
Posts: 2
Joined: 16 Feb 2012, 22:34
Location: Athens

Re: URGENT - Porteus RESCUE MySQL Backup

Post#3 by nikoc1337 » 16 Feb 2012, 22:57

Yea, there are some files there but i need to take a backup of the database

User avatar
brokenman
Site Admin
Site Admin
Posts: 5559
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: URGENT - Porteus RESCUE MySQL Backup

Post#4 by brokenman » 17 Feb 2012, 03:43

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:
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: URGENT - Porteus RESCUE MySQL Backup

Post#5 by Hamza » 17 Feb 2012, 08:18

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.
NjVFQzY2Rg==

Post Reply