mac升级到yosemite之后,mysql无法自动启动解决

1.新建文件

/Library/LaunchDaemons/com.mysql.mysql.plist

2,输入以下内容

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<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>

 3,执行以下命令,最后重启电脑

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

相关推荐