在CentOS設定MariaDB的開機自啟動
作者:chszs,轉載需註明。部落客頁:http://blog.csdn.net/chszs
1、檢查MySQL是否在可管理列表中
[root@Cloud-Q2 ~]# chkconfig --list
abrt-ccpp 0:off1:off2:off3:on4:off5:on6:off
abrtd 0:off1:off2:off3:on4:off5:on6:off
acpid 0:off1:off2:on3:on4:on5:on6:off
atd 0:off1:off2:off3:on4:on5:on6:off
auditd 0:off1:off2:on3:on4:on5:on6:off
autofs 0:off1:off2:off3:on4:on5:on6:off
blk-availability0:off1:on2:on3:on4:on5:on6:off
certmonger 0:off1:off2:off3:on4:on5:on6:off
cgconfig 0:off1:off2:off3:off4:off5:off6:off
cgred 0:off1:off2:off3:off4:off5:off6:off
cpuspeed 0:off1:on2:on3:on4:on5:on6:off
crond 0:off1:off2:on3:on4:on5:on6:off
cups 0:off1:off2:on3:on4:on5:on6:off
haldaemon 0:off1:off2:off3:on4:on5:on6:off
ip6tables 0:off1:off2:on3:on4:on5:on6:off
iptables 0:off1:off2:on3:on4:on5:on6:off
irqbalance 0:off1:off2:off3:on4:on5:on6:off
kdump 0:off1:off2:off3:on4:on5:on6:off
lvm2-monitor 0:off1:on2:on3:on4:on5:on6:off
mcelogd 0:off1:off2:off3:on4:off5:on6:off
mdmonitor 0:off1:off2:on3:on4:on5:on6:off
messagebus 0:off1:off2:on3:on4:on5:on6:off
mysqld 0:off1:off2:off3:off4:off5:off6:off
netconsole 0:off1:off2:off3:off4:off5:off6:off
netfs 0:off1:off2:off3:on4:on5:on6:off
network 0:off1:off2:on3:on4:on5:on6:off
nfs 0:off1:off2:off3:off4:off5:off6:off
nfslock 0:off1:off2:off3:on4:on5:on6:off
ntpd 0:off1:off2:off3:off4:off5:off6:off
ntpdate 0:off1:off2:off3:off4:off5:off6:off
numad 0:off1:off2:off3:off4:off5:off6:off
oddjobd 0:off1:off2:off3:off4:off5:off6:off
portreserve 0:off1:off2:on3:on4:on5:on6:off
postfix 0:off1:off2:on3:on4:on5:on6:off
postgresql 0:off1:off2:off3:off4:off5:off6:off
psacct 0:off1:off2:off3:off4:off5:off6:off
quota_nld 0:off1:off2:off3:off4:off5:off6:off
rdisc 0:off1:off2:off3:off4:off5:off6:off
restorecond 0:off1:off2:off3:off4:off5:off6:off
rngd 0:off1:off2:off3:off4:off5:off6:off
rpcbind 0:off1:off2:on3:on4:on5:on6:off
rpcgssd 0:off1:off2:off3:on4:on5:on6:off
rpcsvcgssd 0:off1:off2:off3:off4:off5:off6:off
rsyslog 0:off1:off2:on3:on4:on5:on6:off
saslauthd 0:off1:off2:off3:off4:off5:off6:off
smartd 0:off1:off2:off3:off4:off5:off6:off
sshd 0:off1:off2:on3:on4:on5:on6:off
sssd 0:off1:off2:off3:off4:off5:off6:off
sysstat 0:off1:on2:on3:on4:on5:on6:off
udev-post 0:off1:on2:on3:on4:on5:on6:off
winbind 0:off1:off2:off3:off4:off5:off6:off
ypbind 0:off1:off2:off3:off4:off5:off6:off
2、如果mysqld沒有在列表,那麼用命令添加它:
# chkconfig add mysqld
我們可以看到,mysqld本來就在列表中,所以這一步我們跳過。
3、使用命令設定開機啟動:
# chkconfig add mysqld
我們再次檢查列表,發現結果是這樣的:
......
mysqld 0:off1:off2:on3:on4:on5:on6:off
......
表示MariaDB的開機自動啟動已經設定完成。