Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
968 views
in Technique[技术] by (71.8m points)

macos - MacOSX: autostart mysql on boot

I just installed mysql in terminal through homebrew.

Now when I try to connect to mysql it fails, but after I run mysqld it works..

So what I need to do now is run mysqld when I boot my Mac.

I've searched Google for mysqld autoload at startup etc. but couldn't find the right answer.

Hope someone can point me in the right direction.. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

brew info mysql gives you the instructions for loading MySQL at startup, but here's all you need to do:

mkdir -p ~/Library/LaunchAgents
cp `brew --prefix mysql`/*mysql*.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/*mysql*.plist

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...