ERROR 1018 (HY000): Can't read dir of './dbname/' (errno: 13)

mysql> use dbname;
mysql> show tables;
ERROR 1018 (HY000): Can't read dir of './dbname/' (errno: 13)

解决方案

To fix this problem you need to set correct permission on /var/lib/mysql/dbname/ directory. Use the command as follows:
cd /var/lib/mysql/
ls -l
chown mysql:mysql dbname/ -R

Replace dbname with actual database directory name. Now you can connect to your mysql server:
mysql -u user -p dbname -e 'show tables;'

 

posted @ 2013-04-21 14:10  win_and_first  阅读(1039)  评论(0编辑  收藏  举报