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