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

我无法在Snow Leopard中启动mysql服务,并在面板上出现信息,

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

我怎样才能解决这个问题?

如果你不能在snow leopard中启动mysql服务,并且在面板上出现“警告用户/ 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.server start

El CapitanSierra为我工作

 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/