在CentOS7中启动mysql,无法启动mysql.service: Unit not found

问题描述 投票:0回答:4

当我输入命令时:

systemctl start mysql
CentOS7
中,我收到以下消息:

Failed to start mysql.service: Unit not found

感谢您的帮助。

mysql hive centos7
4个回答
3
投票

使用命令

service mysqld start

它可以在centos7 for mysql8.0中工作


1
投票

使用此线程。它对我有用。

之后我遇到了同样的错误
yum install mysql

https://stackoverflow.com/a/34654662/7773802


0
投票

我使用

解决了这个问题
1. I uninstalled the mariadb maridb-server packages
2. I removed the directory /var/lib/mysql. ( mv /var/lib/mysql /mysqlbak)
3 Reinstalled the Mariadb, Mariadb-server packages.
4. systemct start mariadb; systemctl enable mariadb (problem solved).

0
投票

我今天遇到了这个错误,我的情况是……mysql实际上安装失败了,但我没有注意到这个错误。如果您运行

which mysql
并且它没有返回 mysql 路径,则很可能是这种情况。或者在尝试安装 MySQL 时检查输出:

yum install mysql-community-server.x86_64

[...]

Public key for mysql-community-server-5.7.44-1.el7.x86_64.rpm is not installed

 Failing package is: mysql-community-server-5.7.44-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

并通过从 mysql 网站导入密钥来修复:

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

然后用 yum 再次开始安装:

yum install mysql-community-server.x86_64
© www.soinside.com 2019 - 2024. All rights reserved.