centos设置Mysql开机自启动
文件会在linux系统各项服务都启动完毕后再被运行,可以将脚本路径加到该文件里

/etc/rc.d/rc.local1.确保权限
chmod +x /etc/rc.d/rc.local
2.创建mysql启动脚本
vi MysqlStart.sh 脚本的内容:
#!/bin/bash
service mysql start给该脚本权限
chmod +x MysqlStart.sh
3.编辑/etc/rc.d/rc.local文件
vi /etc/rc.d/rc.local/path/MysqlStart.sh
4.最后重启,试试效果
reboot
