How To Start and Stop MySQL Database Server From A Shell Prompt

Posted on in Categories , , , last updated May 7, 2008

Q. How do I start and stop mysql server under Debian / Ubuntu Linux system?

A. Simply use service or /etc/init.d/mysql script to start / stop / restart mysql database server.

Task: Start mysql server

# service mysql start
# /etc/init.d/mysql start

OR
$ sudo service mysql start
$ sudo /etc/init.d/mysql start

Task: Stop mysql server

# service mysql stop
# /etc/init.d/mysql stop

OR
$ sudo service mysql stop
$ sudo /etc/init.d/mysql stop

To restart simply, use:
$ sudo service mysql restart
$ sudo /etc/init.d/mysql restart

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment