1,將服務文件複製一份到init.d下,並重命名爲mysqld
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
2,對文件賦予執行權限
chmod +x /etc/init.d/mysqld 或 chmod 777 /etc/init.d/mysqld
3,增加mysqld服務
chkconfig --add mysqld
4,查詢mysqld服務情況
chkconfig --list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off 默認的運行級別爲2,3,4,5
5,如果3,4,5 爲off:
chkconfig --level 345 mysqld on
6,重啓服務器驗證:reboot