Mysql 自动启动的配置

来源:互联网 发布:光年无限科技公司知乎 编辑:程序博客网 时间:2024/04/30 08:50

1. Mysql 自动启动的配置

在MySQL安装程序的解压包
/usr/local/mysql/support-files
myslq.server的启动脚本程序=》 复制/etc/rc.d/init.d目录
[root@localhost ~]# cd /etc/rc.d/init.d
复制并重命名为mysql
[root@localhost init.d]# cp /usr/local/mysql/support-files/mysql.server mysql
更改属性改为“x”(executable,可执行)
[root@localhost init.d]#  chmod +x mysql
添加到系统的启动服务组中
chkconfig --add mysql
启动服务
service mysql start
另:确认
chkconfig --list [name] 用来列表服务 来确认
chkconfig --list [mysql] 或 chkconfig --list
chkconfig --add name 添加服务
chkconfig --del name  删除服务
2. Apache 自动启动的配置
方法一:
apachectl命令拷贝至/etc/rc.d/init.d目录下,改名为httpd
使用编辑器打开httpd文件,并在第一行#!/bin/sh下增加两行文字如下
# chkconfig: 35 70 30
# description: Apache
接着注册该服务
chkconfig --add httpd
service httpd start
其中所增加的第二行中三个数字第一个表示在运行级别3和5下启动apache,
第二、三是关于启动和停止的优先级配置,无关紧要
方法二: 在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl start
启动服务 ......

0 0
原创粉丝点击