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.


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

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


% 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.