1、將服務文件拷貝到init.d下,並重命名爲mysql
#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
2、賦予可執行權限
#chmod +x /etc/init.d/mysql
3、 添加服務
#chkconfig --add mysql
4、查看服務列表
#chkconfig --list
如果看到mysql的服務,並且3,4,5都是on的話則成功,如果是off,則鍵入
#chkconfig --level 345 mysql on
5、#reboot
6、netstat -na | grep 3306,
如果看到有監聽說明服務啓動了