为什么 YUM 显示正在 EC2 上安装 MariaDB 而不是 MySQL

Why is YUM showing that is installing MariaDB instead of MySQL on EC2

我刚刚在其中创建了中型 EC2 和 运行 命令:

sudo yum install mysql -y


这是显示的内容:

Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.52-1.el7 will be installed
--> Finished Dependency Resolution

Install  1 Package

Total download size: 8.6 M
Installed size: 49 M
Downloading packages:
mariadb-5.5.52-1.el7.x86_64.rpm                                                                                                                                                    | 8.6 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:mariadb-5.5.52-1.el7.x86_64                                                                                                                                                            1/1
  Verifying  : 1:mariadb-5.5.52-1.el7.x86_64                                                                                                                                                           1/1

Installed:
  mariadb.x86_64 1:5.5.52-1.el7

Complete!

这是预期的吗?我以为只会看到 MySql 个包。 MariaDB和MySQL有什么关系?

嗯,完全没问题。

简单来说,MySQL 不是 MariaDB - 因为 MariaDB 是 Drop in replacement for MySQL.


MariaDB is a backward compatible, binary drop-in replacement of MySQL. What this means is:

  • Data and table definition files (.frm) files are binary compatible.
  • All client APIs, protocols and structs are identical.
  • All filenames, binaries, paths, ports, sockets, and etc... should be the same.
  • All MySQL connectors work unchanged with MariaDB.
  • The mysql-client package also works with MariaDB server.

In most common practical scenarios, MariaDB version 5.x.y will work exactly like MySQL 5.x.y, MariaDB follows the version of MySQL, i.e. it's version number is used to indicate with which MySQL version it's compatible.


编辑 1:在适当的评论中

why this command does not work? sudo yum install mysql-server Loaded plugins: amazon-id, rhui-lb, search-disabled-repos No package mysql-server available.

默认支持 MariaDB - 要安装 mysql-server,您需要使用 RPM 添加它:

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

添加后,现在可以安装了:

yum -y install mysql-community-server

只是因为mysql现在归oracle所有,所以mysql的作者新建了一个mysql的分支,并命名为mariadb.Now维护由开源社区提供,并且向后兼容。我觉得两者区别不大