现在的位置: 首页 > 综合 > 正文

Yosemite下使用 XAMPP 时 MySql 启动失败解决办法

2018年04月19日 ⁄ 综合 ⁄ 共 602字 ⁄ 字号 评论关闭

出处忘记了,只记得是在百度知道上找到的,牛人无处不在。

使用下面代码可以启动MySql:

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

使用下面的内容将更加方便

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

然后输入

<?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>

然后执行

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

抱歉!评论已关闭.