我刚刚从 Ubuntu 20.04 (MATE) 中删除了 mariadb-server。由于 mysql 客户端无法与 localhost 服务器建立连接,该服务似乎不再运行。
然后,我尝试安装mysql-server-8.0:
roman@TestPlatform:/home/roman$ sudo apt-get install mysql-server-8.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-8.0
0 upgraded, 1 newly installed, 0 to remove and 43 not upgraded.
13 not fully installed or removed.
Need to get 0 B/1.261 kB of archives.
After this operation, 1.465 kB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 271442 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.22-0ubuntu0.20.04.2_amd64.deb ...
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!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.22-0ubuntu0.20.04.2_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.22-0ubuntu0.20.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试使用 ps 命令搜索 mysqld,但没有检测到任何内容。还尝试了:
systemctl stop mysql
systemctl stop mysqld
systemctl stop mariadb
systemctl stop mariadbd
systemctl stop mysql-service
但这些都没有检测到要停止的正在运行的服务。
有什么帮助吗?