MAC體系中添加MYSQL開機啟動的辦法。本站提示廣大學習愛好者:(MAC體系中添加MYSQL開機啟動的辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是MAC體系中添加MYSQL開機啟動的辦法正文
1.添加文件
touch
/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=root</string>
</array>
</dict>
</plist>
3.添加後重啟
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist