Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Please help!

There are server issues and MySql is no longer running on our server (Ubuntu). The service is not recognized and needs to be reinstalled. Unfortunately, the database has not been backed up for 48 hours and that is a lot of information.

How do I reinstall MySql AND keep all my database data? Please note - I can't access mysql at all. I can't use command line mysql nor phpmyadmin.

Thanks in advance and let me know if I am missing important details.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If the database files are accessible, you can follow these steps:

  1. mv /var/lib/mysql /var/lib/mysql.bkp
  2. sudo apt-get install mysql-server
  3. sudo /etc/init.d/mysql stop
  4. mv /var/lib/mysql.bkp /var/lib/mysql
  5. sudo /etc/init.d/mysql start

It should work if you don't have any table file corruption.

share|improve this answer
add comment

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.