您的位置:首页 > 数据库 > MySQL

MySQL Server Status Problem in El Capitan

2016-09-08 14:31 309 查看
I surprisingly found out there is a piece of error dialogue while I opened my MAC today.

Like this,

Could not change automatic startup configuration.



SO, here is my solution of this issue

I had Written a plist script in location /Library/LaunchDaemons/

, and named it com.mysql.plist

This is the original code of automatically start MySQL Server

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


The path /usr/local/mysql/ insides the XML script is where MySQL path built-in El Capitan operation system of my MAC.

Finally, resourcing the script that you written in Terminal and reboot your computer.

sudo chown root:wheel /Library/LaunchDaemons/com.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.plist




simpler solution 2

#brew install mysql
#unset TMPDIR
#mysql_install_db --verbose --user='root' --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
#mysql.server start
#cp cd /usr/local/Cellar/mysql/[version]/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/


The reason why MYSQL Server couldn’t automatically loading is that Apple abandoned the startup items, check this

A note at the start of the page in Apple’s docs explaining this
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐