yosemite mysql 启动,如何在OS X Yosemite / El Capitan上启动时自动加载MySQL

After upgrading OS X my install of MySQL stopped loading on startup.

"The Startup Item installation adds a variable MYSQLCOM=-YES- to the

system configuration file /etc/hostconfig. If you want to disable the

automatic startup of MySQL, change this variable to MYSQLCOM=-NO-."

So, I opened that file and it says:

# This file is going away

AFPSERVER=-NO-

AUTHSERVER=-NO-

TIMESYNC=-NO-

QTSSERVER=-NO-

MYSQLCOM=-YES-

I assume OSX dev's added the # This file is going away but I'm not certain.

If that is the case, what is the proper way to start MySQL on startup on OSX Yosemite?

解决方案

This is what fixed it:

First, create a new file: /Library/LaunchDaemons/com.mysql.mysql.plist

KeepAlive

Label

com.mysql.mysqld

ProgramArguments

/usr/local/mysql/bin/mysqld_safe

--user=mysql

Then update permissions and add it to launchctl:

sudo chown root: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值