How to Start Stop Restart Mysql from Command Line


Restart, Start, Stop MySQL from the Command Line Terminal, OSX, Linux

To restart, start or stop MySQL server from the command line, do the following at the shell prompt…

Start Stop Restart Mysql Commands

Start Mysql on Linux — /etc/init.d/mysqld start
Stop Mysql on Linux — /etc/init.d/mysqld stop
Restart Mysql on Linux — /etc/init.d/mysqld restart

Other Linux flavours Operating System

For Mysql start — service mysqld start or service mysql start

For Mysql stop — service mysqld stop or service mysql stop

For Mysql restart — service mysqld restart or service mysql restart


On OS X to start/stop/restart MySQL from the command line:

Start Mysql on MAc OSx —
sudo /usr/local/mysql/support-files/mysql.server start

Stop Mysql on MAc OSx —

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

Restart Mysql on MAc OSx —

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

Share me!