1

The full error is:

MySQL ERROR 13 (HY000): Can't get stat of './databasename' (Errcode: 13 - Permission denied)

I can't create databases in the mysql shell. I can log in as root just fine and I've granted all privileges to the root user, flushed privileges and exited/logged back in multiple times. Nothing seems to work.

I'm on Ubuntu GNOME 15.04. This worked fine on 14.04, but I'd rather not downgrade if I don't have to.

2 Answers 2

1

Wrong permissions, the server runs as mysql. Correct with:

sudo chown -R mysql:mysql /var/lib/mysql/databasename

example:

% top -u mysql
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                                             
15891 mysql     20   0    4472   1684   1536 S   0,0  0,0   0:00.00 mysqld_safe                                                                                                                                                         
16240 mysql     20   0  728684 117020  12068 S   0,0  2,9   0:00.38 mysqld
0
0

Yes, it's all about permission.

But in my macbook 2017, i should set mysql permission to specific data folder like

sudo chown -R mysql:mysql /usr/local/mysql/data

And now it's works

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .