Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Control MySQL server with launchd' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Control MySQL server with launchd
Authored by: af3556 on Jan 14, '09 06:59:59PM
Using the Sockets key to "on-demand" start the MySQL server only works partly and by accident. The Sockets key requires the job to use a launch API (launchd.plist.5). Using the above config causes launchd to create the socket in /tmp/mysql.sock, and when the client connects launchd notices and starts the server. The MySQL server sees that the socket exists but it doesn't expect it to, as it didn't create it, so removes it and creates its own. From then on all is business as usual. Meanwhile the first client is left hanging on a socket that has now been unlinked and won't ever be answered. This has been tested on 10.5.5, MySQL 5.0.75 installed via Macports. Also if the server exits (is shutdown or crashes), I'm not sure that launchd will recreate it. So it doesn't look like it's possible to start the mysqld server on-demand, at least until someone adds launchd support to mysql.

[ Reply to This | # ]