2

I have a Macbook. Forever I’ve had mysql server installed and running on start (using El Capitan).

Well now I’ve installed Wine. Since then mysql server fails to start on reboot. If I manually run ./mysqld from /usr/local/mysql/bin it works fine. Here’s where things go weird: if I use launchctl list then pipe that using grep to see the list of running processes I can’t see the mysql (but I know it's running!)

Terminal window running mysqld:

enter image description here

Terminal window running my grep search to show no mysql processes running [searched for GPG as a control group to show what it should look like when working:

enter image description here

Back when I got the setup running before, I used this: https://stackoverflow.com/a/35445024/2226328 with no problems nor issues. Now since installing wine using: brew install wine I can’t get mysqld to load on start. Any ideas?

Since this I've uninstalled wine and had the same problem, I ran brew update as well but have since determined that I installed mysql separately.

Edit: Some final followup here. Once I ran sudo launchctl list | grep mysql it showed my mysqld running ...looking at the system.log for mysql entries showed it was failing to start which led to creating an error log plist entry mentioned in the answer below. changing permissions on the mysql folder recursively fixed the issue. This command will show you the name of your mysql user on the system: dscacheutil -q user | grep mysql

1 Answer 1

4

Depending on where you installed com.oracle.oss.mysql.mysqld.plist you may have to run:

sudo launchctl list | grep mysql

to check if com.oracle.oss.mysql.mysqld.plist is in the launchctl database.

Even if you find it that doesn't necessarily mean that mysql is loaded at start-up. Open Activity Monitor or enter ps | grep mysqld in Terminal.app to check if it is running.


If you get an error like that in your system log:

com.apple.xpc.launchd[1]: (com.oracle.oss.mysql.mysqld) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

unload the plist and add two lines to com.oracle.oss.mysql.mysqld.plist

<key>StandardErrorPath</key>
<string>/tmp/mysql.err</string>

Be sure to properly chmod/chown the file afterwards:

sudo chown root:wheel /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo chmod 644 /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

and reload the launch daemon

sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

Open the file /tmp/mysql.err in Console and check for further problems.

7
  • I see its installed but its not running something is causing to 3/16/16 8:25:02.023 PM com.apple.xpc.launchd[1]: (com.oracle.oss.mysql.mysqld) Service only ran for 0 seconds. Pushing respawn out by 10 seconds. within my log repeatedly ... hmmm I think I'll try to chown on the launchctl plist after getting owner attributes in that director Mar 17, 2016 at 3:27
  • okay... it's failing to set the datadir in /usr/local/mysql/data I'm gonna see if it exists and make if not....Also this is my full errorlog as it's clearly much more than that: puu.sh/nJqiW/2f73c393c9.png Mar 17, 2016 at 4:00
  • hmm should I be chown on the datadir to _mysql? Mar 17, 2016 at 4:23
  • @Frankenmint The directory data usually contains all databases and other files and folders. The default permissions are drwxr-x--- _mysql _mysql...
    – klanomath
    Mar 17, 2016 at 4:39
  • thanks, I ended up using sudo chown -R _mysql mysql to recursively set permissions on ` /usr/local/mysql/` directory now works on restart as it should...what you've provided was very helpful to troubleshoot this though! Thanks I'll mark it as solved. Mar 17, 2016 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .