can someone please steer me in the right direction. I'm completely new to Monit, set it up, everything working fine, but I'm having a problem with mysql.

This is the set up in my conf file:

check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host port 3306 then restart
if 5 restarts within 5 cycles then timeout

But when I try to enable monitoring, it just wont have it. Checked my log files:

monit[8199]: 'mysql' process is not running 
monit[8199]: 'mysql' trying to restart
monit[8199]: 'mysql' start: /etc/init.d/mysql
monit[8199]: 'mysql' failed to start

I've looked for the mysqld.pid file in that path, but all that's present is mysqld.sock.. Not sure if this has something to do with it. Hope someone can help, cheers!

1 Answer 1


It seems your configuration is ok.

Does your MySQL run in normal conditions ? Can you try in console as root:

/etc/init.d/mysql start

If not you must solve the start problem first, then try to test the configuration.

Another problem could be permissions, try removing the line:

group database

I hope this help you.

  • Hi thanks for your reply. When I run /etc/init.d/mysql start it always gives: Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql start Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, e.g. start mysql - Hmm, strange..I've removed group database too.. still not liking it May 19, 2011 at 15:36
  • 1
    Just restarted! It's working, I removed group database and added pid-file=/var/run/mysqld/mysqld.pid to my.cnf - something did the trick, cheers!! May 19, 2011 at 15:46

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