Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
Fedora 5?! It went end of life OVER 5 YEARS AGO: redhat.com/archives/fedora-announce-list/2007-July/… –  HTTP500 Jan 20 '13 at 17:12

2 Answers 2

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.

share|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. –  Framework 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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