title: mysqladmin ping error code
body: <p>Mysqladmin ping returns 0 even with a password failure, a thing that mysqlclient doesn't. Is this a mistake from Mysqladmin Developpers? I don't understand why Mysqladmin is asking for a login/password because it returns 0 even if you don't specify a login.</p>
  
  <p>If I try a Mysqladmin ping without any login/password :</p>
  
  <pre><b># mysqladmin ping ; echo $?</b>
  
  mysqladmin: connect to server at 'localhost' failed
  error: 'Access denied for user 'root'@'localhost' (using password: NO)'
  0</pre>
  
  <p>Mysqladmin give me a login error and tells me that the server is currently running (0 value) so why asking for a login if it still gives me the answer?</p>
  
  <p><br />When I do something like this :</p>
  
  <pre><b>#mysqladmin -uroot -pWrongPassword ping ; echo $?</b>
  
  mysqladmin: connect to server at 'localhost' failed
  error: 'Access denied for user 'root'@'localhost' (using password: YES)'
  0</pre>
  
  <p>This return me 0 instead of 1.</p>
  
  <p><br />Now if I stop mysql server and try again :</p>
  
  <pre><b># mysqladmin -uroot -pWrongPassword ping ; echo $?</b>
  
  mysqladmin: connect to server at 'localhost' failed
  error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
  Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
  1</pre>
  
  <p>It gives me the proper value because the server is stopped, we dont care about the wrong password.</p>
  
  <p><br />Finally i did the same test with Mysqlclient and a wrongpassword :</p>
  
  <pre><b># mysql -uroot -pWrongPassword mysql -sN -e "select * from user" ; echo $?</b>
  
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  1</pre>
  
  <p>I know that the main purpose of this command is to test the availability of the mysql server but ask for a login/password doesn't make any sense if you still give the 0 value.</p>
  
  <p>Do you think it is a bug?</p>