Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

how can i make mysql start automatically on linux?

share|improve this question

migrated from Dec 21 '09 at 12:38

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

You should atl east specify which linux distribution you're using. – nos Dec 21 '09 at 12:36

Here are the complete steps to make sure mysql is started at boot time on RHEL4. They need to be run with root permission.

chkconfig --list mysqld

Unless you installed mysqld in a non-default way, this should show that mysqld is set to start at run levels 3,4 and 5:

mysqld          0:off	1:off	2:off	3:on	4:on	5:on	6:off

If this isn't the case, set up the correct run levels. If you didn't get any output from the previous command:

chkconfig --add mysqld


chkconfig --level 345 mysqld on

Finally, use chkconfig --list again to make sure you're set up correctly.

share|improve this answer

This will depend on your linux distribution. On Debian/Ubuntu something like this would work:

$ sudo update-rc.d mysql defaults
share|improve this answer

If you have installed mysql from the package manager it should set it up to start by default.

share|improve this answer

And on a RHEL derivate, it'll work like this:

sudo /sbin/chkconfig mysqld on
share|improve this answer

Your Answer


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