This is a quick post as much to remind myself the next time I need it as anything about how to start and stop MySQL from a terminal window on OS X.

Start:

sudo /usr/local/mysql/support-files/mysql.server start

Stop:

sudo /usr/local/mysql/support-files/mysql.server stop

3 thoughts on “Start/Stop MySQL from a terminal session on OS X

  1. If you’ve installed a custom compiled mysql package then you need to edit the mysql.server file and change the paths for $basedir around lines 292 to your own version. On mine: mysql -> mysql-5.1.24

  2. @Shane…I actually set up an alias in my .bash_profile script that allows me to do this with much less typing:

    alias myup='sudo /usr/local/mysql/support-files/mysql.server start'

    AND

    alias mydown='sudo /usr/local/mysql/support-files/mysql.server stop'

    Once you restart your Terminal session to read the new .bash_profile, you can just type myup to start MySQL and mydown to stop it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*