Hunter Ford Hunter Ford

MySQL Startup Item for Mac OS X

Save the following as /Library/LaunchDaemons/org.mysql.mysqld.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>RunAtLoad</key>
	<true/>
	<key>Umask</key>
	<integer>7</integer>
	<key>UserName</key>
	<string>_mysql</string>
	<key>Disabled</key>
	<false/>
	<key>WorkingDirectory</key>
	<string>/usr/local/mysql</string>
	<key>GroupName</key>
	<string>_mysql</string>
	<key>KeepAlive</key>
	<true/>
	<key>Program</key>
	<string>/usr/local/mysql/bin/mysqld</string>
	<key>Label</key>
	<string>org.mysql.mysqld</string>
	<key>ProgramArguments</key>
	<array>
		<string>--user=_mysql</string>
	</array>
</dict>
</plist>

And in a bash session, run the following:

sudo chown root:wheel /Library/LaunchDaemons/org.mysql.mysqld.plist
sudo launchctl load /Library/LaunchDaemons/org.mysql.mysqld.plist
sudo launchctl start org.mysql.mysqld

Downloads


Comments