首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我们在Centos7上安装了Centos7企业级服务器-高级版(商业版)

我们在Centos7上安装了Centos7企业级服务器-高级版(商业版)
EN

Server Fault用户
提问于 2015-10-29 14:34:56
回答 1查看 159关注 0票数 0

在启动服务器关闭并启动时,我总是必须手动启动它。有人帮我把它设置为启动时使用systemctl启用

代码语言:javascript
运行
复制
[root@localhost ~]# systemctl enable mysqld

Failed to issue method call: Access denied

[root@localhost ~]# systemctl status mysqld

mysqld.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@localhost ~]# systemctl status mysql

mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql)

   Active: active (running) since Mon 2015-10-26 10:18:16 EDT; 2 days ago
   CGroup: /system.slice/mysql.service
                ├─1485 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/trimdb03.pid
 └─2523 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --
plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-

error=/var/lib/mysql/mysql.err --pid-file=/...

Oct 26 10:18:06 localhost systemd[1]: Starting LSB: start and stop MySQL...

Oct 26 10:18:16 localhost mysql[1244]: Starting MySQL......... SUCCESS!

Oct 26 10:18:16 localhost systemd[1]: Started LSB: start and stop MySQL.

[root@localhost ~]# systemctl enable mysql

mysql.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysql on

The unit files have no [Install] section. They are not meant to be enabled
using systemctl.

Possible reasons for having this kind of units are:

1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.

2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.

3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).

[root@localhost ~]#
EN

回答 1

Server Fault用户

发布于 2015-10-29 14:40:55

出于某种原因,MySQL正在使用一个旧风格的init脚本,甚至在使用systemd的CentOS 7上也是如此。他们应该分发一个适当的systemd单元文件,但选择不分发。

启用旧样式init脚本的正确方法是使用chkconfig,即:

代码语言:javascript
运行
复制
chkconfig mysql on

如果这仍然失败,那么您需要对Oracle支持联系人非常大声和愤怒。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/732534

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档