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;'

 

转载于:https://www.cnblogs.com/win-and-first/archive/2013/04/21/mysql.html

你可能感兴趣的:(ERROR 1018 (HY000): Can't read dir of './dbname/' (errno: 13))