文章目录 方法1:systemctl enable 方法2:/etc/rc.local 方法3:chkconfig 应用场景 方法1:systemctl enable 启用 开机自动启动 的命令 systemctl enable 关闭 开机自动启动 的命令 systemctl disable 示例:设置MySQL开机自动启动 systemctl enable mysqld 备注:该方法不是所有场景都能用 方法2:/etc/rc.local /etc/rc.local是rc.d/rc.local的软链 1、编辑文件 vim /etc/rc.local 2、添加需要执行的内容 date