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

发布于 2024-10-13 06:17:56 字数 502 浏览 2 评论 0原文

文件所有者和文件所有者应该做什么?组为 /usr/local/mysql 以及所有包含的文件和文件。目录? MySQL 工作正常,但是在我执行 sudo chown -R $USER:staff /usr/local 安装 Homebrew,MySQL 无法在启动时自动启动,并且在 MySQL 首选项面板上,我收到“警告:/usr/local/mysql/data 目录不属于 'mysql' 或 '_mysql'用户”,当我单击“启动 MySQL 服务器”时,它没有连接。

为了解决这个问题,我运行了 sudo chown -R _mysql:wheel /usr/local/mysql/data 。然后,我关闭了&打开系统偏好设置。警告消失了,当我单击“启动 MySQL 服务器”时,它启动了!

MySQL 现在似乎响应良好,但我只是猜测这个解决方案。我的做法正确吗?

What should the file owner & group be of /usr/local/mysql and all contained files & directories? 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.

To fix this, I ran 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 seems to be responding fine now, but I just guessed at this solution. Is what I did correct?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉薄对峙 2024-10-20 06:17:56

对我来说看起来有效。这就是我的 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

如果 MySQL 本身没有正确连接所有内容,你是如何安装 MySQL 的?

编辑:这是数据文件夹的一般风格:

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

我不在我的机器上运行Homebrew,所以我不知道这是否有很大帮助。

Looks valid 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 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, so I don't know if this is of much help as far as that goes.

当爱已成负担 2024-10-20 06:17:56

我遇到了完全相同的问题,MattDiPasquale 的答案对我有用。我必须一直运行 mysqld 以确保 MySQL 正常运行。当我在系统偏好设置中查看 MySQL 时,我意识到我遇到了同样的错误。

I had the exact same problem and MattDiPasquale’s answer worked for me. I had to keep running mysqld all the time to ensure MySQL was running properly. When I looked at MySQL in the System Preferences I realised I had the same error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文