1、利用 chkconfig 来配置启动级别
所有的脚本都在/etc/init.d/
如果要查询当前所有自动启动的服务
chkconfig –list
如果只想看指定的服务,只需要在 “–-list” 之后加上服务名就好了,比如查看httpd服务是否为自动启动
chkconfig –-list httpd
这个时候2~5都是on,就表明会自动启动了
chkconfig httpd on –开机启动
chkconfig httpd off –关闭开机启动
chkconfig –add mysqld –添加服务到chkconfig列表中
chkconfig –del mysqld –从chkconfig移除服务
2、修改 /etc/rc.d/rc.local 这个文件:
vi /etc/rc.d/rc.local
/etc/rc.d/init.d/mysqld start