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

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, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):