任2519 发表于 2016-5-16 11:17:09

让MySQL在 Mac OS X Yosemite上开机启动

先用命令行vi建立这个XML
sudo vi /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 chown root /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chgrp 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
页: [1]
查看完整版本: 让MySQL在 Mac OS X Yosemite上开机启动