Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been Googling and banging my head against this one for quite a while now. I have not installed MySQL on this system before and just installed version 5.6 via MacPorts and have run sudo mysql_install_db following the port installation. I couldn't get the server to start though.

To diagnose the problem, I tried running sudo -u _mysql /opt/local/lib/mysql56/bin/mysqld and get output like...

2013-10-03 21:40:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-10-03 21:40:13 23189 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql56/ is case insensitive
2013-10-03 21:40:13 23189 [Note] Plugin 'FEDERATED' is disabled.
/opt/local/lib/mysql56/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2013-10-03 21:40:13 7fff7c8c2180  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.

When I run sudo ls -l /opt/local/var/db/mysql56/, I see...

-rw-r--r--   1 root    _mysql         0 Aug  4 15:00 .turd_mysql56-server
-rw-rw----   1 _mysql  _mysql        56 Oct  2 23:09 auto.cnf
-rw-rw----   1 _mysql  _mysql  50331648 Oct  3 22:50 ib_logfile0
-rw-rw----   1 _mysql  _mysql  50331648 Oct  2 23:09 ib_logfile1
-rw-rw----   1 _mysql  _mysql  12582912 Oct  3 00:10 ibdata1
drwx------  81 root    _mysql      2754 Oct  3 00:10 mysql
drwx------  55 root    _mysql      1870 Oct  3 00:10 performance_schema
drwx------   2 root    _mysql        68 Oct  3 00:09 test

When I run sudo ls -l /opt/local/var/db/mysql56/mysql, I see...

-rw-rw----  1 root  _mysql    1024 Oct  3 00:09 plugin.MYI
-rw-rw----  1 root  _mysql    8586 Oct  3 00:09 plugin.frm
-rw-rw----  1 root  _mysql       0 Oct  3 00:09 proc.MYD

I presume that is what I should see for the file ownership and permissions. Any ideas?

share|improve this question
Is this question more appropriate for here or for S.O.? – Steve Jorgensen Oct 4 '13 at 5:54
up vote 4 down vote accepted

Log in as root and execute:

chown -R _mysql:_mysql /opt/local/var/db/mysql56
share|improve this answer
Doh! I thought the group ownership was enough, but didn't notice that the group rw permissions were not present on mysql, performance_schema and test directories (since sudo ls -l /opt/local/var/db/mysql56/ was an afterthought). I suppose this whole problem would not have occurred if i had run sudo -u _mysql mysql_install_db instead of sudo mysql_install_db. Correct? – Steve Jorgensen Oct 4 '13 at 18:58

you are running mysql as user _mysql, so _mysql needs to have permission on the database directories

cd /opt/local/var/db/mysql56/mysql
chown -R _mysql mysql performance_schema test
share|improve this answer
Also correct, I believe, but of course, I can only accept one answer. – Steve Jorgensen Oct 4 '13 at 18:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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