mysql.service 丢失但显示在列表中 - 安装失败

标签 mysql linux ubuntu ubuntu-17.04

我在 Ubuntu 17.04 上。

长话短说,在与 MariaDB 较量一番之后,我遵循了一些关于如何完全从我的家庭服务器中删除 MySQL 和 MariaDB 的可疑建议。现在我无法重新安装 mysql-server。我在尝试时遇到此错误:

Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!

所以我用 sudo service --status-all | 检查服务grep mysql,果然...

[ - ]  mysql

问题是,当我尝试 sudo service mysql status 时,我得到了

Unit mysql.service could not be found.

我真的很想在不进行全新安装的情况下安装 MySQL 并再次运行!感谢您的帮助。

最佳答案

看来我明白了。这没有任何意义,但我明白了。首先,我询问 dpkg 是否还有任何 mysql 包:

sudo dpkg --get-selections | grep mysql

没有任何结果,所以我检查了 MariaDB:

sudo dpkg --get-selections | grep maria

这显示了一些标记为卸载的软件包。

mariadb-client-10.1                             deinstall
mariadb-common                                  deinstall
mariadb-server-10.1                             deinstall

因为 apt 没有合作,我用 dpkg -P 卸载了每一个。一旦我这样做并重新启动,mysql 不再列为服务并且 mysql-server 安装完美。希望这能为其他人节省一些时间。

关于mysql.service 丢失但显示在列表中 - 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45494749/

相关文章:

c++ - 将共享内存指针类型转换为整数指针

postgresql - pgAdmin 和终端 : FATAL: password authentication failed for user

mysql - 无法在 MySQL 数据库中创建数据类型为 TEXT 的列

mysql - Ruby on Rails 无法使用 MySQL 创建/使用应用程序

python - 在 MAC OS 或 Linux 中创建快捷方式链接文件或文件夹

linux - 在另一个文件中查找一个文件的内容

php - 使用连接库时如何在 codeigniter 上创建别名

mysql - 将长文本描述存储在数据库或文件系统中更好吗?

linux - 如何在 Linux 中为 opencl 编程(安装英特尔 OpenCL SDK)准备 eclipse

phpbrew php7 抛出 gnutls_handshake() 失败 : Illegal parameter