Mysql – How to take backup of thesql databases from the crashed server

backupfedoraMySQL

I have linux server running Fedora 5. My server is crashed now and I can not access mysql.

But I can still have access to my hard disk. Since It is crashing again and again now I really want to upgrade my Fedora copy to latest version But also want to make sure that all the databases should be restored. So How do I take the backup of mysql databases?

Mysql databases are stored in /var/lib/mysql directory.

Is it okay to take the backup of this directory and restore backup when server is up?

Can I access these databases once I copy this mysql directory to my new server?

How do I go so that all the mysql databases will be accessible on my new server environment.

Best Answer

The answer is a definite maybe. If you're really running fedora 5, you're probably also running a mysql version from the stone age.

So if you copy /var/lib/mysql/* over to a new machine and start mysql, it may or may not read your crashed files. And it may or may not want to upgrade some data formats.

But try it and see what happens. Before that, make at least another backup of those files, so you have something to work with should the new mysql version mess them up.

Related Topic