Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Windows a command like net start mysql will try to start the MySQL service. I am looking for equivalent Linux command to do that - to change the status of services through Linux commands.

share|improve this question

migrated from Jan 10 '12 at 4:29

This question came from our site for professional and enthusiast programmers.

It depends somewhat on what distro you're using. Many use the scripts in /etc/rc.d, but Ubuntu encourages you to use service. – Kevin Jan 10 '12 at 4:01
up vote 3 down vote accepted

A lot of linux'es support the service command

service mysql.server start

This is related to chkconfig

[root@iceweasel init.d]# chkconfig --list mysql.server

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

mysql.server    0:off   1:off   2:on    3:on    4:on    5:on    6:off

Otherwise you can do it the old fashioned way

cd /etc/init.d
./mysql.server start
share|improve this answer
init.d/rc.d depends on the distro. – Andrew Jan 10 '12 at 5:01
@Andrew totally - can you remember/know some distro's that still use the /etc/rc.d style and I'll list them and I will add them to my answer with accreditation. – Adrian Cornish Jan 10 '12 at 5:06

Your "service" scripts are all stored in /etc/init.d, so the normal way is to use sudo /etc/init.d/mysqld start (or whatever service you want to start). Modern Linux distributions have the service command which does a similar thing, so also try service mysqld start.

share|improve this answer

Usually Linux distros have an rc script; for example:

/etc/rc.d/apache2 restart | stop
/etc/rc.d/mysqld start | stop
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.