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:
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;'
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop




![[ERROR] /usr/local/libexec/mysqld: unknown variable ‘thread_concurrency=8′](http://s13.cyberciti.org/images/shared/rp/3/1.jpg)
![MySQL Import Command [ Database Import ]](http://s13.cyberciti.org/images/shared/rp/3/18.jpg)






{ 5 comments… read them below or add one }
Thanks that worked. I was coping the files from an old drive, and even though I used `-p` flag to `cp`, the ownership was weird (wasn’t mysql:mysql)… Not sure what was up with that :)
Thank a ton for your valuable effort and heko
Great, it fixed my problem
Thanks, you’re helpful
thanks so much for your entry here! Everywhere else I read suggested this was a number of files open issue, but your answer was correct! I had chown’d it to mysql:root before, but that apparently wasn’t enough.