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

Posted: 0p in MySQL

When I access the database. I got the following error

ERROR 1018 (HY000): Can’t read dir of ‘./dbname/’ (errno: 13)
140301 12:35:35 [ERROR] /usr/sbin/mysqld: Can’t find file:

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

Solution :-

Check the directory permission for /var/lib/mysql/dbname

Use the command as follows:

cd /var/lib/mysql/
ls -l /var/lib/mysql/dbname
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;’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s