Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to re-install MySQL.

But if there is some trouble,the best will be recover the original one.

Is it possible to achieve this?

share|improve this question
How is it currently installed? How are you intending to install the new version? What platform/distro? Do you have data backups? Do you need to need to migrate the data to a new version? What version are you upgrading to/from? Please provide more information in your question. – theotherreceive Aug 29 '09 at 16:46

For your other questions, I think you only need to "yum install" the mysql packages that you have uninstalled. If you mean "recovering the data", you always need to make a backup copy of the mysql data before the upgrade, I would recommend to make logical and raw backups.

Also you need to check if you're going to perform a major upgrade (like going from mysql 3 o mysql 5) and check which other packages depend on the current installed MySQL.

share|improve this answer

if you just want to be able to roll back your reinstallation, do this:

  1. backup /etc/mysql/my.cnf
  2. shut down mysql
  3. backup the mysql data directory, /var/lib/mysql on most linux distors.

reinstall/upgrade your server.

if you need to roll back, shut down mysql and copy those files back.

share|improve this answer

You haven't specified the platform, so it's hard to be really specific, but the process is the same regardless. Make sure you know where the current installation's files are and back them up, making extra sure you have any and all config files, which are unlikely to be in the same location as the rest of the files. Backup the data by doing a full dump of all databases, including the mysql database, using whatever method you prefer. Stop the service(s) and do your reinstall. All going well, that's the end of it. If things go bad just restore your backups.

share|improve this answer

Your Answer


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.