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

I recently added mysql.server to start during the start up by doing this:

cd /etc/rc.d/rc5.d/
ln -s  /etc/init.d/mysql.server S98mysql

I have perhaps not correctly understood the <number> part of s<number>script / k<number>script naming convention for the RC scripts.

Although, I know that it's for: representing the order in which the script will be executed during the run of runlevel control script.

Picked up S98mysql from: How To Install MySQL : 6.0 Automatic MySQL Start-up during boot

But MySQL does not start during startup. Will show this message when trying to connect (as expected):

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Works fine if I do a manual start with: /etc/init.d/mysql.server start
What am I doing wrong?

I am using Fedora 15.

share|improve this question
up vote 3 down vote accepted

If you are using Fedora you might want to use chkconfig.

To see what run levels a particular service is enabled for, you can do something like this

chkconfig --list <servicename> 


chkconfig --list mysqld

To change the behavior for certain run levels for a service you can do something like this:

chkconfig --levels 345 mysqld on 

or since your init.d script has a different name

chkconfig --levels 345 mysql.server on

If a service isn't listed in chkconfig you can add it with the --add flag. Use the script name found in /etc/init.d.


chkconfig --add mysql.server

Wikipedia has more information on run levels.

Most servers only go to run level 3 which would mean that run level 5 is not reached so the service would not be started in your example.

Most desktops go to run level 5 since that is when the graphical interface (X) starts.

share|improve this answer
mysql.server script says: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 where as the chkconfig --list does not list mysql at all though S98mysql is present in cd /etc/rc.d/rc5.d/. – ThinkingMonkey Jan 12 '12 at 18:41
The start levels in the script are what chkconfig uses for default values. Try adding the service with "chkconfig --add mysql.server" Also you can set a list of all the services that are managed with chkconfig by running "chkconfig --list" – ckliborn Jan 12 '12 at 18:44
hmmm looking into it. – ThinkingMonkey Jan 12 '12 at 18:45
did this chkconfig --add mysql.server and a reboot to my system. MySQL is starting as expected. Thank you. – ThinkingMonkey Jan 12 '12 at 18:52

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.