MySQL installed in Homebrew cannot be started on EI Capitan.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.