1

I'm having trouble starting MySQL as a system-wide daemon at startup time. I created a simple .plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>Program</key>
    <string>/usr/local/bin/mysqld</string>
  </dict>
</plist>

and put it in /Library/LaunchDaemons which according to this article is where system level daemons should be placed. I changed the ownership to root

chown root <path_to_plist>
chgrp admin <path_to_plist>
chmod 644 <path_to_plist>

When I rebooted the daemon did not appear to be running (ps returned nothing, mysql was not able to connect). I was able to start the daemon manually

sudo launchctl load <path_to_plist>

but not automatically.

I eventually moved the .plist to ~/Library/LaunchAgents and after changing the ownership to the logged-in user and rebooting, the daemon finally started.

  • Why is mysqld not running under /Library/LaunchDaemons?
  • Would running from ~/Library/LaunchAgents create another mysqld instance if another user did the same? (I would like to avoid that)

Thank you!

Dmitry
  • 161
  • 1
  • 1
  • 10

1 Answers1

0

I did what appears in the link and it worked for me

https://stackoverflow.com/a/26492593/1071459

Hope it helps. Try redoing all the steps and not only correcting your code, sometimes a character changes it all...

Community
  • 1
  • 1
loco.loop
  • 1,441
  • 1
  • 15
  • 27