I am using launchd to start mysql on boot, it is working fine. I am able to stop and start the service using 'launchctl unload' and 'launchctl load' commands. Also I am able to start the service by typing 'mysqld_safe' command in terminal. But, if I stop the service through 'launchctl stop' and then start the service through 'mysqld_safe' command, I am unable to stop the service through 'launchctl stop'. Is this possible? What I am doing wrong here?

My Plist is:

<?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">


Command used to start mysql through terminal is:

mysqld_safe --defaults-file=/path/to/mysql/my.cnf --port=3306 --socket=/path/to/mysql/tmp/mysql.sock --datadir=/path/to/mysql/data --pid-file=/path/to/mysql/data/mysqld.pid

1 Answer 1


This is intended behavior. Issuing launchctl stop for a job which has not been loaded does not work.

  • To expand on this: if it wasn't started by the launchd daemon, it's not a launchd job can't be managed with launchctl -- it's just an independent process that happens to be running the same program that your launchd job would run. Sep 5, 2013 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.