我使用的是 Fedora 29。
我尝试运行 mariadb.service
使用命令:
systemctl start mariadb
,
并给出错误:
Failed to start mariadb.service: Unit mariadb.service not found.
此外,我尝试了以下命令:
systemctl status mariadb
Unit mariadb.service could not be found.
systemctl start mariadb.service
Failed to start mariadb.service: Unit mariadb.service not found.
systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.
systemctl enable mariadb
Failed to enable unit: Unit file mariadb.service does not exist.
systemctl daemon-reload
<nothing to output>
我尝试使用 sudo
和没有。结果是一样的。
mariadb-server
已安装:
dnf install mariadb-server
Package mysql-community-server-8.0.15-1.fc29.x86_64 already installed.
刚开始使用Linux,我不明白有什么问题。
最佳答案
您安装了 MySQL 8,这就是您安装 MariaDB 失败的原因:两者冲突,您必须选择您想要的一个。
如果你想安装MariaDB,你首先必须先卸载MySQL 8:
dnf remove mysql-community-server
dnf install mariadb-server
历史上,MySQL 和 MariaDB 都曾使用 mysql
作为服务名称。 MySQL 8 软件包仅使用 mysql
服务名称,而 MariaDB 同时具有 mariadb
和 mysql
服务,后者是 mariadb
服务的别名。
MariaDB 在 10 系列版本中很早就添加了自己的服务名称,并且还为其他命令添加了别名。例如,mariadb
命令与 MariaDB 10.5 中的 mysql
命令是同一程序。
关于mysql - 错误 "Failed to start mariadb.service: Unit mariadb.service not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54501338/