How to properly stop MySQL server on Mac OS X? I installed MySQL Community Server following instructions at 

http://dev.mysql.com/doc/refman/5.0/en/macosx-installation.html


with the Startup Item and the MySQL Preference Pane.

I can stop the server with

$ /usr/local/mysql/bin/mysqladmin -u root -p shutdown 
Enter password:
$ ps aux | grep mysqld
.... grep mysqld


Is this the proper way?

Every time when I try to stop the sever using System Preference -> MySQL -> Stop MySQL Server, it hangs.  I will need to force quit the System Preference from the dock.  Any idea why the hang or how to find out?
DISCLAIMER : Not a MacOS user

That is an alternative way. This shutdown method can be done in MacOS, Linux, Windows, any platform MySQL is supported in.

I actually prefer your mysqladmin method for a reason...

In Linux, I have seen the mysql.sock (the socket file) file just up and disappear without warning. The standard way to shutdown mysql in Linux is service mysql stop. Whenever the socket file disappears, the mysqld_safe program cannot shutdown without first seeing in the socket file. Such a standard shutdown would just hang.

I usually connect using TCP/IP

/usr/local/mysql/bin/mysqladmin -u root -h127.0.0.1 -p shutdown  


Doing it this way bypasses checking for a socket file. Of course, you must make sure root@127.0.0.1 exists. Run these lines to create that user:

SET SQL_LOG_BIN=0;
GRANT ALL PRIVILEGES ON *.* TO root@'127.0.0.1' IDENTIFIED BY 'whateverpassword';


CAVEAT If you do DESC mysql.user;, you will see that one of the privilege columns is Shutdown_priv. This evidently would permit a user who connects to mysqladmin to issue a shutdown. Users with this privilege cannot issue a shutdown from the mysql client. Users with shutdown_priv='Y' can only be done from mysqladmin.