Which user should have / usr / local / mysql on Mac?

What should the file owner and group /usr/local/mysql and all contained files and directories have? MySQL worked fine, but after I did sudo chown -R $USER:staff /usr/local to install Homebrew , MySQL could not start automatically at startup and in MySQL Settings Panel, I got a "Warning: directory / usr / local / mysql / data does not belong to the user "mysql" or "_mysql", and when I clicked the "Start MySQL Server" button, it did not connect.

To fix this, I ran sudo chown -R _mysql:wheel /usr/local/mysql/data . Then I closed and opened System Preferences. The warning disappeared, and when I clicked the "Start MySQL Server" button, it started!

MySQL seems to be responding fine now, but I just figured out this solution. What did i do right?

+63
mysql file-ownership macos
Jan 21 '11 at 18:42
source share
2 answers

Looks to me. This is what my mysql folder looks like:

 drwxr-xr-x 17 root wheel 578 May 7 2010 . drwxr-xr-x 8 root wheel 272 Jun 11 2010 .. -rw-r--r-- 1 root wheel 17987 May 7 2010 COPYING -rw-r--r-- 1 root wheel 5139 May 7 2010 EXCEPTIONS-CLIENT -rw-r--r-- 1 root wheel 9339 May 7 2010 INSTALL-BINARY -rw-r--r-- 1 root wheel 62989 May 7 2010 README drwxr-xr-x 46 root wheel 1564 May 7 2010 bin drwxr-x--- 15 _mysql wheel 510 Jan 21 08:15 data drwxr-xr-x 4 root wheel 136 May 7 2010 docs drwxr-xr-x 34 root wheel 1156 May 7 2010 include drwxr-xr-x 22 root wheel 748 Jun 3 2010 lib drwxr-xr-x 4 root wheel 136 May 7 2010 man drwxr-xr-x 15 root wheel 510 May 7 2010 mysql-test drwxr-xr-x 3 root wheel 102 May 7 2010 scripts drwxr-xr-x 35 root wheel 1190 May 7 2010 share drwxr-xr-x 29 root wheel 986 May 7 2010 sql-bench drwxr-xr-x 16 root wheel 544 May 7 2010 support-files 

How did you install MySQL if it didn’t hook everything correctly?

EDIT: and this is the general taste of the data folder:

 drwxr-x--- 15 _mysql wheel 510 Jan 24 08:15 . drwxr-xr-x 17 root wheel 578 May 7 2010 .. -rw-rw---- 1 _mysql wheel 158773 Jan 24 08:16 $USER.local.err -rw-rw---- 1 _mysql wheel 4 Jan 24 08:15 $USER.local.pid drwx------ 6 _mysql wheel 204 Jun 16 2010 $SOME_DB_NAME1 drwx------ 6 _mysql wheel 204 Jun 8 2010 $SOME_DB_NAME2 drwx------ 15 _mysql wheel 510 Jan 18 11:23 $SOME_DB_NAME3 drwx------ 12 _mysql wheel 408 Jan 20 14:40 $SOME_DB_NAME4 -rw-rw---- 1 _mysql wheel 5242880 Jan 24 08:15 ib_logfile0 -rw-rw---- 1 _mysql wheel 5242880 Jan 24 08:15 ib_logfile1 -rw-rw---- 1 _mysql wheel 18874368 Jan 21 17:31 ibdata1 drwx------ 85 _mysql wheel 2890 Jun 3 2010 $SOME_DB_NAME5 drwx------ 85 _mysql wheel 2890 Jun 3 2010 $SOME_DB_NAME6 drwxr-x--- 71 _mysql wheel 2414 Jun 3 2010 mysql drwx------ 21 _mysql wheel 714 Aug 31 17:27 $SOME_DB_NAME7 

I do not run Homebrew on my machine, therefore, I do not know how this can help.

+41
Jan 21 '11 at 19:40
source share

I had the same issue and MattDiPasquales answer worked for me. I had to constantly run mysqld to ensure that MySQL was working correctly. When I looked at MySQL in System Preferences, I realized that I had the same error.

+1
Oct 21 '13 at 7:58
source share



All Articles