警告 user/local/mysql/data 目录不属于 mysql 用户

发布于 2024-10-30 03:15:56 字数 147 浏览 1 评论 0原文

我无法在 Snow Leopard 中启动 mysql 服务,并且在面板首选项中出现以下消息:

警告user/local/mysql/data目录不属于mysql用户

我该如何解决这个问题?

I can't start the mysql service in Snow Leopard, and in the panel prefs appears the message,

warning the user/local/mysql/data directory is not owned by the mysql user

How can I fix this?

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

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

发布评论

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

评论(2

看海 2024-11-06 03:15:56

如果在雪豹中无法启动 mysql 服务,并且在面板首选项中出现“警告 user/local/mysql/data 目录不属于 mysql 用户”,则必须:

  • sudo chown -RL root :mysql /usr/local/mysql
  • sudo chown -RL mysql:mysql /usr/local/mysql/data
  • sudo /usr/local/mysql/support-files/mysql .服务器启动

If you can't start mysql service in snow leopard, and in the panel prefs appears 'warning the user/local/mysql/data directory is not owned by the mysql user', you have to:

  • sudo chown -RL root:mysql /usr/local/mysql
  • sudo chown -RL mysql:mysql /usr/local/mysql/data
  • sudo /usr/local/mysql/support-files/mysql.server start
嘦怹 2024-11-06 03:15:56

这对我来说是在 El Capitan & 工作的。 塞拉

sudo chown -R _mysql:wheel /usr/local/mysql/data

就是这样。


更新:修复自动启动

我发现如果您也修复自动启动,它会更有用:

sudo nano /Library/LaunchDaemons/com.mysql.mysql.plist

并粘贴:

<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true />
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/mysql/bin/mysqld_safe</string>
      <string>--user=mysql</string>
    </array>        
  </dict>
</plist>

保存它,然后:

sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

然后它将在重新启动时加载。

参考:https://coolestguidesontheplanet.com/get-apache-mysql -php-phpmyadmin-working-osx-10-10-yosemite/

This work for me in El Capitan & Sierra

sudo chown -R _mysql:wheel /usr/local/mysql/data

That's it.


Update: to fix auto start

I found it more useful if you fix Auto Starting too:

sudo nano /Library/LaunchDaemons/com.mysql.mysql.plist

And paste in:

<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true />
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/mysql/bin/mysqld_safe</string>
      <string>--user=mysql</string>
    </array>        
  </dict>
</plist>

Save it and then:

sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

Then it will load on a restart.

Reference: https://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/

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