MySQL startup script under BSD/Linux

in Categories last updated March 30, 2006

You can start the MySQL server directly as described here. But most Linux distribution comes to special start and stop script. First, you must login as the root user. Use su – command to login as the root user.

If you are using Red Hat Linux / Fedora Linux:
Start MySQL

# service mysql start

OR

# /etc/init.d/mysql start

Stop MySQL

# service mysql stop

OR

# /etc/init.d/mysql stop

If you are using Debian Linux:
Start MySQL

# /etc/init.d/mysql start

Stop MySQL

# /etc/init.d/mysql stop

If you are using FreeBSD:
Open /etc/rc.conf file and add following line:

vi /etc/rc.conf

And append following line:

mysql_enable=”YES”

To Start MySQL under FreeBSD:

#/usr/local/etc/rc.d/mysql-server.sh start

To Stop MySQL under FreeBSD:

#/usr/local/etc/rc.d/mysql-server.sh stop

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 1 comments/add one below):

1 comment

  1. None of these commands are recognised in Windows7 command prompt mode.
    Does anyone know how to reset the root password in Xammp on Windows 7?

    Have a question? Post it on our forum!