1
I have problems running MySQL (I'm in rescue disk and can't run anything) and I would like to backup up the databases from the system files because I'm planning on formatting the system. How can I do that?
Thank you.
1
I have problems running MySQL (I'm in rescue disk and can't run anything) and I would like to backup up the databases from the system files because I'm planning on formatting the system. How can I do that?
Thank you.
3
If your system is not completely dead (i.e. MySQL service can be started):
1) Boot from rescue media
2) Mount your system disk
mount /dev/sdX /mnt/tmp
3) Mount virtual filesystems
mount -o bind /dev /mnt/tmp/dev
mount -t proc proc /mnt/tmp/proc
mount -t sysfs sys /mnt/tmp/sys
4) Change root
chroot /mnt/tmp
5) When you're in chroot'ed environment, start MySQL service
/etc/init.d/mysql start
6) Make db backup as you do it normally
Don't forget to check your backup before formatting; you can also backup raw MySQL db files, backups never hurt.
0
Here are two things you can try.
The first might work the second ought to work but is more complicated.
Copy the database files (usually found at $SOMEPATH/mysql/data
). Make a fresh installation of mysql (use same version and os as the source). Dump the database files in the new installations data
dir. Start mysql and it might work.
Mount the disk on a working computer. Use "Percona Xtrabackup" ta take a backup of the data. Then use that backup to restore. (don't ask how to use Xtrabackup, read the docs)
Make sure the rights are identical. Use
cp -rp
or rsync to be sure. – SPRBRN – 2014-01-23T12:42:52.287