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

To start, stop or restart MySQL server from the command line, type the following at the command prompt(shell).


1. On Linux start/stop/restart from the command line:

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

Some Linux flavors offer the service command too

service mysqld startservice mysqld stopservice mysqld restartor
service mysql startservice mysql stopservice mysql restart

2. On macOS Sierra & OS to start/stop/restart MySQL post 5.7  from the command line:

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

3. On OS X to start/stop/restart MySQL pre 5.7  from the command line:

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

Related Tags:

uninstall mysql mac
error mysql server pid file could not be found
how to run mysql on mac
start mysql command line mac
mysql server not starting mac
mysql server wont start mac sierra
restart mysql centos 7
mac mysql command line
restart mysql ubuntu
uninstall mysql mac
install mysql server mac
how to use mysql on mac
mysql server command not found
stop mysql server windows
install mysql workbench mac
mysql el capitan
restart mysql mac brew
brew mysql start
restart mysql centos
innodb: unable to lock ./ibdata1 error: 35
mac run mysqld as root
could not load mysql preference pane
brew reset mysql password
brew install mysql specific version
brew install mysqldump
the server quit without updating pid
my.cnf location mac
mysql server won t start mac sierra
brew mysql logs
brew services logs
error: formula `mysql` is not installed.
mac restart mysql brew
brew restart postgres
can’t stop mysql server mac
homebrew stop mysql
high sierra mysql
how to upgrade mysql on mac
uninstall mysql mac sierra
mysql server won’t start mac sierra
mysql server instance is stopped mac
install mysql high sierra
install mysql preference pane mac
mac mysql reset root password
mac mysql command not found
restart mysql ubuntu
uninstall mysql mac
install mysql server mac
how to use mysql on mac
mysql server command not found
stop mysql server windows
install mysql workbench mac
mysql el capitan
restart mysql mac brew
brew mysql start
restart mysql centos
innodb: unable to lock ./ibdata1 error: 35
mac run mysqld as root
could not load mysql preference pane
brew reset mysql password
brew install mysql specific version
brew install mysqldump
the server quit without updating pid
my.cnf location mac
mysql server won t start mac sierra
brew mysql logs
brew services logs
error: formula `mysql` is not installed.
mac restart mysql brew
brew restart postgres
can’t stop mysql server mac
homebrew stop mysql
high sierra mysql
how to upgrade mysql on mac
uninstall mysql mac sierra
mysql server won’t start mac sierra
mysql server instance is stopped mac
install mysql high sierra
install mysql preference pane mac
mac mysql reset root password
mac mysql command not found