Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR 1018 (HY000): Can't read dir of './<db>/' (errno: 13) - *not* a permission issue

Tags:

mysql

Today I updated openssl (due to the recent heartbleed vulnerability) and all of a sudden mysql is acting strangely. I was recently able to modify tables, but now when I try to add a column I get:

ERROR 1005 (HY000): Can't create table '#sql-34f_872b' (errno: 13)

And trying to do show tables results in:

ERROR 1018 (HY000): Can't read dir of './<db>/' (errno: 13)

During the openssl upgrade there was a prompt asking about an upgrade to mysql. It was asking if I want to keep my current /etc/my.cnf or if I wanted to replace with the new one - I selected to keep.

Typically this would be a permissions issue, and I've tried and tested the permissions on the mysql datadir (using this answer from a similar question).

A few other strange things:

  • When I try these commands, I'm using the mysql command client and logged in as root
  • I am able to insert new rows into existing tables

I feel like the openssl upgrade is too much of a coincidence to ignore, and I'm not keen on the idea of restarting mysqld without really knowing that the server will definitely come back up (since there's an unknown issue going on here).

Any ideas?


Reply to comments and questions:

Output of ls -ltrFa:

remy@ip-10-168-9-52:~$ ls -ltrFa /vol/mysql/
total 49367084
-rwxr-xr-x 1 mysql mysql           0 Feb 11  2013 debian-5.5.flag*
drwxr-xr-x 2 mysql mysql        4096 Feb 11  2013 test/
drwxr-xr-x 2 mysql mysql        4096 Feb 11  2013 performance_schema/
drwxr-xr-x 2 mysql mysql        4096 Feb 11  2013 mysql/
-rwxr-xr-x 1 mysql mysql           6 Feb 11  2013 mysql_upgrade_info*
-rwxr-xr-x 1 mysql mysql          25 Feb 12  2013 slave-relay-bin.index*
-rwxr-xr-x 1 mysql mysql         126 Feb 12  2013 slave-relay-bin.000001*
drwxr-xr-x 6 mysql mysql        4096 Oct 14 14:35 ./
drwxr-xr-x 2 mysql mysql        4096 Apr  3 15:50 jsbin/
drwxrwxrwx 5 root  root         4096 Apr  9 16:07 ../
-rwxr-xr-x 1 mysql mysql 50417631232 Apr  9 17:24 ibdata1*
-rwxr-xr-x 1 mysql mysql    67108864 Apr  9 17:24 ib_logfile0*
-rwxr-xr-x 1 mysql mysql    67108864 Apr  9 17:25 ib_logfile1*

Output of ps aux | grep mysql:

mysql      847  1.4 83.9 16342212 14681964 ?   Ssl   2013 3646:34 /usr/sbin/mysqld
remy      4038  0.0  0.0 101816  2824 pts/0    S+   16:58   0:00 mysql -uroot -px xxxxx jsbin

Note that I've also tried running mysql using sudo -u mysql mysql -uroot -pxxx jsbin and it results in the same issue.

Here is the the log from the apt-get upgrade openssl which shows mysql being included in the update: https://gist.github.com/remy/10291829

Server is ubuntu-precise-12.04-amd64 (installations are all via apt-get rather than manually compiled).

Versions of mysql:

$ mysqld --version
mysqld  Ver 5.5.29-0ubuntu0.12.04.1 for debian-linux-gnu on x86_64 ((Ubuntu))
$ mysql --version
mysql  Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.2
like image 268
Remy Sharp Avatar asked Apr 09 '14 16:04

Remy Sharp


1 Answers

The following worked for me :

rm /var/lib/mysql/ib_logfile*

/etc/init.d/mysql restart
like image 62
Ali Avatar answered Sep 18 '22 02:09

Ali