mysql_config suse_suse chkconfig命令

在opensuse上安装好mysql之后,需要调成自动开机启动模式,结果发现用chkconfig --level 35 mysqld on的时候报错,原来suse上chkconfig和红帽系列chkconfig用法有些不同。参看帮助chkconfig --help(或者man chkconfig):

usage:

chkconfig -A|--allservices              (together with -l: show all services)

chkconfig -t|--terse [names]            (shows the links)

chkconfig -e|--edit  [names]            (configure services)

chkconfig -s|--set   [name state]...    (configure services)

chkconfig -l|--list [--deps] [names]    (shows the links)

chkconfig -c|--check name [state]       (check state)

chkconfig -a|--add   [names]            (runs insserv)

chkconfig -d|--del   [names]            (runs insserv -r)

chkconfig -h|--help                     (print usage)

chkconfig -f|--force ...                (call insserv with -f)

chkconfig [name]             same as chkconfig -t

chkconfig name state...      same as chkconfig -s name state

chkconfig --root= ...  use as the root file system

可以看出其中更改启动等级就已经不是--level参数了,而是-s,如要mysqld在35启动,可以chkconfig -s mysqld 35。

有几点需要说明的是:当执行chkconfig -s mysqld on启动之后,mysqld启动的默认加载的配置模式,如果默认是2345启动,那就是2345启动。默认加载可以在对应的服务名称的脚步更改,如mysqld。vi /etc/init.d/mysqld,找到

### BEGIN INIT INFO

# Provides: mysql

# Required-Start: $local_fs $network $remote_fs

# Should-Start: ypbind nscd ldap ntpd xntpd

# Required-Stop: $local_fs $network $remote_fs

# Default-Start:  2 3 4 5 (默认启动模式)

# Default-Stop: 0 1 6 (默认禁止模式)

# Short-Description: start and stop MySQL

# Description: MySQL is a very fast and reliable SQL database engine.

### END INIT INFO

修改相应启动模式即可。

如果更改某个服务的启动模式,只需开启其需要开启的选项接口,如mysqld现在在2345模式下运作,想禁掉4模式,只需输入以下命令:

chkconfig -s mysqld 235

可能会因为某些依赖关系报错,可以使用-f强制开启。

另外的细节问题可以参看man

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值