在 RHEL 7 中重新启动 Mysql

在 RHEL 7 中重新启动 Mysql

我正在尝试在 RHEL7 中重新启动 Mysql

以下是已安装的软件包:

]$ yum list installed | grep mysql
rh-mysql57-lz4.x86_64                r131-7.el7        @rhel-server-rhscl-7-rpms
rh-mysql57-mecab.x86_64              0.996-1.el7.9     @rhel-server-rhscl-7-rpms
rh-mysql57-mysql.x86_64              5.7.24-1.el7      @rhel-server-rhscl-7-rpms
rh-mysql57-mysql-common.x86_64       5.7.24-1.el7      @rhel-server-rhscl-7-rpms
rh-mysql57-mysql-config.x86_64       5.7.24-1.el7      @rhel-server-rhscl-7-rpms
rh-mysql57-mysql-errmsg.x86_64       5.7.24-1.el7      @rhel-server-rhscl-7-rpms
rh-mysql57-mysql-server.x86_64       5.7.24-1.el7      @rhel-server-rhscl-7-rpms
rh-mysql57-runtime.x86_64            2.3-4.el7         @rhel-server-rhscl-7-rpms
rh-php71-php-mysqlnd.x86_64          7.1.30-2.el7      @rhel-server-rhscl-7-rpms

$ systemctl list-unit-files | grep mysq

rh-mysql57-mysqld.service                     enabled
[email protected]   

$systemctl restart mysqld

Failed to restart mysqld.service: Unit not found.

$service mysqld restart

Failed to restart mysqld.service: Unit not found.

有人能给我指出正确的方向吗?

答案1

该服务的名称是 rh-mysql57-mysqld.service

您可以使用以下命令找出所有服务名称:

systemctl list-units --type service

因此,要重新启动,请执行以下操作:

$ systemctl restart rh-mysql57-mysqld.service

相关内容