Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How restore /var/lib/mysql (UBUNTU 10.04) after i delete it?

History:

  1. delete /var/lib/mysql folder

  2. paste new /var/lib/mysql folder with wrong files

  3. delete again /var/lib/mysql folder

  4. clean + reinstall mysql

result after reinstall:/var/lib/mysql folder not exist

Thanks, Yosef

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Restoring /var/lib/mysql can be done by putting back a backup. If you did not have a backup, you've lost your database. The only thing that can be done is reinstalling the MySQL server:

sudo apt-get --reinstall install mysql-server-5.1

FYI, the MySQL root password is stored in /etc/mysql/debian.cnf.

share|improve this answer
    
Thanks, I run the command but i see in shell: Unpacking replacement mysql-server-5.1 ... and shell not write after that nothing just waiting for something –  Yosef Mar 15 '11 at 13:44
    
Have you removed your /var/lib/mysql directory before reinstalling? If possible, remove (or rename) /etc/mysql to something else and try again. –  Lekensteyn Mar 15 '11 at 13:52
    
Thanks, Its help when i restart computer. –  Yosef Mar 15 '11 at 14:48
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.