第一步:新建start文件,裏面的內容如下
#!/bin/bash
#chkconfig: 2345 80 08
#description: Start
echo "service iptables stop"
service iptables stop
echo "Starting MySQL Service ..."
/opt/sudytech/mysql/bin/mysqld_safe &
注:linux服務器mysql開機自啓動 (這個是我百度微雲裏的,已分享,可以下載查看)
第二步:
1)放在/etc/rc.d/init.d/start
2)把start的屬性改成 “777”(chmod -R 777 /etc/rc.d/init.d/start)
3)查看start的屬性是否修改成功 ls -l /etc/rc.d/init.d/start
4)運行 chkconfig --add start