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.

| improve this question | | | | |

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.

| improve this answer | | | | |
  • mysql version is not old it is 5.x, I recently upgraded PHP and MySql on this server, However yum did't find the latest version of PHP but I was able to do so anyway. Let us see what happen when I go with the new server. I will keep posting. – Shakti Singh Jan 21 '13 at 14:45

Yes, copying that directory (assuming that is your configured mysql data directory) along with your mysql configuration file is all you need.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.