Restart, Start, Stop MySQL through Command Line Terminal, OSX, Linux

Linux start/stop/restart

/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld restart

In some linux, run the following commond.

service mysqld start
service mysqld stop
service mysqld restart

or

service mysql start
service mysql stop
service mysql restart

 

In OS X,  to start/stop/restart MySQL pre 5.7 using command line:

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

 

In OS X Yosemite/El Capitan, to start/stop/restart MySQL using the command line:

sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist