Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to monitor whether our mysql server is up. The command I'm using for this is:

mysqladmin ping

It will return the following:

mysqld is alive

Does this just check whether the process is currently running or does it also check whether the server is accepting connections?

share|improve this question
up vote 3 down vote accepted

"mysqladmin ping" attempts to connect to the chosen MySQL server. The actual server can be specified with the -h option (e.g. mysqladmin ping -h, defaulting to localhost.

If the server responds (even with an access denied or similar message), the server is assumed to be alive and "mysqladmin ping" exits with code 0.

Otherwise, the server is assumed to be down and "mysqladmin ping" exists with code 1.

share|improve this answer

If you want to be certain that your MySQL server is up, the best thing to do is to write a small script to execute:


Your user for connecting would need at least USAGE permission. This won't tell you if there are any problems with your database tables, but your application monitoring will probably tell you this.

It's entirely possible that this is what mysqladmin ping does anyway.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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