MacOS – MySQL does not start on startup

macosMySQLstartupsystem-prefs

In the System Preferences panel, I have the MySQL there.

enter image description here

enter image description here

I chose it to start up every time my Mac starts up, however this doesn't work, I have restarted MySQL many times, but it will not start up at all – which I require to start up manually.

How can I fix this?

Best Answer

Starting MySQL server automatically actually means executing the /usr/local/mysql/bin/mysqld dæmon on startup. If MySQL won't do it for you, it's easy enough to add the necessary instructions yourself.

For this, we'll add a launchd job descriptor to the /Library/LaunchDaemons folder. The procedure is very well described in this Mac OS X Hints article.


Note: I would have liked to copy and edit it here, since it adds some details that are unnecessary in this case, but I couldn't find license information about Mac OS X Hints' content, so I'll simply link.