简体   繁体   English

用户应该在Mac上拥有/ usr / local / mysql?

[英]What user should own /usr/local/mysql on Mac?

What should the file owner & group be of /usr/local/mysql and all contained files & directories? 文件所有者和组应该是/usr/local/mysql以及所有包含的文件和目录? MySQL was working fine, but after I did sudo chown -R $USER:staff /usr/local to install Homebrew , MySQL couldn't automatically start on startup, and on the MySQL Preferences panel, I got "Warning: The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user," and when I clicked Start MySQL Server, it didn't connect. MySQL工作正常,但在我做了sudo chown -R $USER:staff /usr/local安装Homebrew后 ,MySQL无法在启动时自动启动,在MySQL Preferences面板上,我收到了“警告:/ usr / local / mysql / data目录不归'mysql'或'_mysql'用户所有,“当我点击启动MySQL服务器时,它没有连接。

To fix this, I ran sudo chown -R _mysql:wheel /usr/local/mysql/data . 为了解决这个问题,我运行了sudo chown -R _mysql:wheel /usr/local/mysql/data Then, I closed & opened System Preferences. 然后,我关闭并打开了系统偏好设置。 The warning went away, and when I clicked Start MySQL Server, it started! 警告消失了,当我点击启动MySQL服务器时,它就开始了!

MySQL seems to be responding fine now, but I just guessed at this solution. MySQL似乎现在回应得很好,但我猜对了这个解决方案。 Is what I did correct? 我做的是正确的吗?

Looks valid to me. 看起来对我有效。 This is what my mysql folder looks like: 这是我的mysql文件夹的样子:

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 it if it didn't hook everything up correctly itself? 如果它没有正确地连接所有内容,你是如何安装它的?

EDIT: and this is the general flavor 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 don't run Homebrew on my machine, tho, so I dunno if this is of much help as far as that goes. 我没有在我的机器上运行Homebrew,所以我不知道如果这对你有很大的帮助。

I had the exact same problem and MattDiPasquale's answer worked for me. 我有完全相同的问题,MattDiPasquale的答案对我有用。 I had to keep running mysqld all the time to ensure MySQL was running properly. 我必须一直运行mysqld以确保MySQL正常运行。 When I looked at MySQL in the System Preferences I realised I had the same error. 当我在系统偏好设置中查看MySQL时,我发现我遇到了同样的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误。 服务器退出而不更新 PID 文件 (/usr/local/mysql/data/Mac.local.pid) - ERROR! The server quit without updating PID file (/usr/local/mysql/data/Mac.local.pid) 在Mac OS X Lion上的$ / usr / local / mysql / bin内,为什么Mysql无法启动? - Why does Mysql not start when inside of $ /usr/local/mysql/bin on Mac OS X Lion? 每个最终用户帐户应该在mysql中获取自己的表吗? - Should each end user account get their own table in mysql? 在Mac上托管mySQL的本地服务器,数据库URL是什么? - Local server hosting mySQL on Mac, what's the database URL? MySQL不从/ usr / local / mysql / data加载数据库文件 - MySQL Not loading Database File from /usr/local/mysql/data Django用户从MySQL迁移到PostgreSQL时应该知道什么? - What should a Django user know when moving from MySQL to PostgreSQL? 我应该授予InnoDB MySQL用户哪些特权? - What privileges should I grant to my InnoDB MySQL user? mysql --version在brew install mysql之后仍然显示/ usr / local / mysql / bin / mysql - mysql --version still shows /usr/local/mysql/bin/mysql after brew install mysql 用户“应该”拥有我的SQLite数据库吗? - Should the user “apache” own my SQLite database? Android从远程MySQL服务器(PHP)更新多个本地SQLIte表,该怎么办? - Android update multiple local SQLIte tables, from remote MySQL server(PHP), what should I do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM