首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在19.10上安装MySQL?

如何在19.10上安装MySQL?
EN

Ask Ubuntu用户
提问于 2020-04-17 16:55:30
回答 1查看 828关注 0票数 0

因此,我跟踪这个指南来安装MySQL,但是我得到了一个错误,即预先安装的mariadb-client-core-10.3冲突,并且没有满足依赖关系,但是我无法安装它们,因为它们依赖于MySQL。所以完整的日志在这里:

代码语言:javascript
复制
$sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb

(Reading database ... 290842 files and directories currently installed.)
Preparing to unpack mysql-common_8.0.19-1ubuntu19.10_amd64.deb ...
Unpacking mysql-common (8.0.19-1ubuntu19.10) over (8.0.19-1ubuntu19.10) ...
dpkg: regarding mysql-community-client_8.0.19-1ubuntu19.10_amd64.deb containing mysql-community-client:
 mysql-community-client conflicts with mariadb-client-core-10.3
  mariadb-client-core-10.3 (version 1:10.3.22-0ubuntu0.19.10.1) is present and installed.

dpkg: error processing archive mysql-community-client_8.0.19-1ubuntu19.10_amd64.deb (--install):
 conflicting packages - not installing mysql-community-client
Selecting previously unselected package mysql-client.
Preparing to unpack mysql-client_8.0.19-1ubuntu19.10_amd64.deb ...
Unpacking mysql-client (8.0.19-1ubuntu19.10) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack mysql-community-server_8.0.19-1ubuntu19.10_amd64.deb ...
Unpacking mysql-community-server (8.0.19-1ubuntu19.10) ...
Selecting previously unselected package mysql-server.
Preparing to unpack mysql-server_8.0.19-1ubuntu19.10_amd64.deb ...
Unpacking mysql-server (8.0.19-1ubuntu19.10) ...
Setting up mysql-common (8.0.19-1ubuntu19.10) ...
dpkg: dependency problems prevent configuration of mysql-client:
 mysql-client depends on mysql-community-client (= 8.0.19-1ubuntu19.10); however:
  Package mysql-community-client is not installed.

dpkg: error processing package mysql-client (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on mysql-client (= 8.0.19-1ubuntu19.10); however:
  Package mysql-client is not configured yet.
 mysql-community-server depends on mysql-community-server-core (= 8.0.19-1ubuntu19.10); however:
  Package mysql-community-server-core is not installed.

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-community-server (= 8.0.19-1ubuntu19.10); however:
  Package mysql-community-server is not configured yet.

dpkg: error processing package mysql-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-community-client_8.0.19-1ubuntu19.10_amd64.deb
 mysql-client
 mysql-community-server
 mysql-server




$ sudo apt-get remove --purge mariadb-client-core-10.3

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 akonadi-backend-mysql : Depends: mariadb-client-core-10.3 but it is not going to be installed or
                                  virtual-mysql-client-core
 mysql-client : Depends: mysql-community-client (= 8.0.19-1ubuntu19.10) but it is not installable
 mysql-community-server : Depends: mysql-community-server-core (= 8.0.19-1ubuntu19.10) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我运行sudo apt-get -f install时,它请求我允许删除,所以:

代码语言:javascript
复制
The following packages will be REMOVED:
  mysql-client mysql-community-server mysql-server

我该怎么办?谢谢你的时间。

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2020-04-18 17:31:39

尝试使用apt安装mysql,但首先,停止mariadb进程:

代码语言:javascript
复制
sudo systemctl stop mariadb

然后继续通过apt安装mysql。

代码语言:javascript
复制
sudo apt update

sudo apt install mysql-server

然后运行这个程序,然后按照步骤执行

代码语言:javascript
复制
sudo mysql_secure_installation

然后,您应该能够登录到mysql shell。

代码语言:javascript
复制
mysql -uroot -p

编辑:

您也可以完全删除mariadb,然后运行命令sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb。命令删除mariadb

代码语言:javascript
复制
apt remove --purge mariadb mariadb-*

警告:通过运行此命令,您的数据库可能会被删除。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1228017

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档