MySQL 5.7.12 installed with Homebrew is inexplicably suspended. Looking at the system logs, you can see a bunch of such prompts:
Jun 2 20:08:49 maid com. apple. xpc. launchd [1] (homebrew. mxcl. mysql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
This prompt is sent every 10 seconds, from noon till now.
MySQL is started using the servies sub-command provided by Homebrew:
Sudo brew service start mysql
This command is simple, probably like this:
Cp/usr/local/opt/mysql/homebrew. mxcl. mysql. plist/Library/LaunchDaemons
Sudo launchctl load/Library/LaunchDaemons/homebrew. mxcl. mysql. plist
I have introduced how to install lighttpd on Mac OS X.
After several tossing times, I found another piece of information like this:
Jun 2 20:11:08 maid com. apple. xpc. launchd [1] (homebrew. mxcl. mysql): This service is defined to be constantly running and is inherently inefficient.
This leads to an incorrect direction. Some people say this is caused by Apple suggest avoiding KeepAlive and RunAtLoad. I deleted KeepAlive and RunAtLoad from homebrew. mxcl. mysql. plist. Of course, they are useless.
Next, check/usr/local/var/mysql/{your-mac}. err to find out the real problem:
2016-06-02T15: 11: 34.350795Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
Note that the time in this log document is Greenwich Mean Time.
It turns out that the file cannot be written. Check whether the permission for this err file is _ mysql: admin, so you can change the entire/usr/local/var/mysql folder to the same as the permissions for all the files below:
Sudo chown-r _ mysql: admin/usr/local/var/mysql
Of course, you can also install the mysql database without using Homebrew, which may be better to avoid unnecessary troubles.