Welcome to WebmasterWorld Guest from 54.224.83.221

Forum Moderators: open

Starting Database with launchd

     
9:43 am on Mar 13, 2018 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 22, 2004
posts: 140
votes: 0


I'm running OS X 10.11. My database server is installed and runs fine when I manually start it using mysql.server start;

So I created a LaunchDeamon script to start it on system boot. Problem is, it doesn't seem to work. It absolutely is a properly formatted launchd script though. root:wheel 644 and it's in /Library/LaunchDeamons and yet, nothing:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.l008com.mysql.mariadb</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/mysqld_safe</string>
<string>--datadir=/usr/local/var/mysql</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>


AND YET... and this is where it gets super annoying. If I run the following command manually in the terminal, the database starts right up!

sudo /usr/local/bin/mysqld_safe --datadir=/usr/local/var/mysql
10:00 am on Mar 13, 2018 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 22, 2004
posts: 140
votes: 0


Well just as soon as I start this post, the manual command doesn't seem to be working any more either.

So I changed the launchd.plist to run this command instead:
/usr/local/bin/mysql.server start


But even that is not working at boot, even though that definitely works when ran manually in the terminal!

I am now fully confused!