When I run the following command at mysql> I get an error which read as follows:
mysql> use dbname;
mysql> show tables;
ERROR 1018 (HY000): Can’t read dir of ‘./dbname/’ (errno: 13)
How do I fix this problem under Debian Linux?
To fix this problem you need to set correct permission on /var/lib/mysql/dbname/ directory. Use the command as follows:
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;'