# How do I stop the MySQL server?



## vikingshelmut (Feb 12, 2003)

I have successfully installed and setup the MySQL server using Fink.  I know the proper terminal command to start the server:

/sw/bin/safe_mysqld &

How do I stop it?
I've installed Xmysqladmin also with Fink, and when I try to stop the server, it times out.
I've tried killing the mysqld daemon with kill -9 "PID", and it just respawns with a new PID.

Yes i know you can restart and that will kill the server, but I'd rather be able to stop it on my own.

Thanks for the help!


----------



## bluehz (Feb 12, 2003)

Not sure if your install has this - but many unix/Linux apps have a "ctl" script that is usually just a wrapper script to cleanly star/stop/restart services. Apache has one, Qmail has one, and in my case my install of MySQL has one. Try issuing:

mysqlctl stop

The usage for this is:
usage: /usr/local/sbin/mysqlctl start|stop

If you have no luck with it - try issuing the full path command:

/usr/local/sbin/mysqlctl stop


----------



## Gnomo (Feb 12, 2003)

The standard way to stop MySQL is to use the mysqladmin tool.  It works like this:

mysqladmin -u root -p password (if you set a password for root) shutdown 

If everything goes right, the daemon will shutdown the server, if not...time to use kill.

Edit:Note: This assumes that you have set the path for MySQL.  If you haven't you will have to run mysqladmin from it's path.  I believe that is /usr/local/mysql-version#/bin/


----------

