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