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.

I accidentally remove the document /var/lib/mysql and when I tried to connect to the databases, the following information came up:

mysql> show databases;
ERROR 1018 (HY000): Can't read dir of '.' (errno: 13)

What can I do with this? Any help will be grateful!

share|improve this question

1 Answer 1

If you deleted /var/lib/mysql and all of its sub-directories then you most likely deleted all of your data. I am not sure if you can recover it at this point.

If you just want to get mysql working again, then just use apt-get to delete mysqld and install it again to have /var/lib/mysql created again.

share|improve this answer
    
Actually, I just want to get mysql to work again. But how can I delete the mysqld with the apt-get? And how to recreate it? –  daniel Mar 18 '13 at 4:00
    
Run to remove: sudo apt-get remove mysql-server Run to install again: sudo apt-get install mysql-server –  notkevin Mar 18 '13 at 4:06
    
I did these two step but I can not find the document /var/lib/mysql. What should I do? –  daniel Mar 18 '13 at 4:12
    
I found this solution. I think it may work. unix.stackexchange.com/questions/27549/… –  daniel Mar 18 '13 at 4:23

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.