当我输入命令时:
systemctl start mysql
在CentOS7
中,我收到以下消息:
Failed to start mysql.service: Unit not found
感谢您的帮助。
使用命令
service mysqld start
。
它可以在centos7 for mysql8.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).
我今天遇到了这个错误,我的情况是……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