Question: I am trying to install mysql in amazon linux 2 ami and am not able to do it.

```
sudo yum install mysql56-server -> doesn't work
amazon-linux-extras list -> doesn't list mysql

```

I do not want mariadb since I have more exposure to mysql (even if both are the same)

Answer: 
I got the answer myself. Follow the below steps:

```
sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm 
sudo yum install mysql-community-server
systemctl start mysqld.service

```

The key is to add the source repo and then install since Amazon Linux 2 doesn't have the default repos in place already.
For people who need mysqldump (ie, for Wordpress on ec2), install mariadb from the native amzn2-core repo.

```
   yum install mariadb.x86_64
   mysqldump -v

```

Info about the package:

```
# yum info mariadb.x86_64
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Installed Packages
Name        : mariadb
Arch        : x86_64
Epoch       : 1
Version     : 5.5.68
Release     : 1.amzn2
Size        : 49 M
Repo        : installed
From repo   : amzn2-core
Summary     : A community developed branch of MySQL
URL         : http://mariadb.org
License     : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a community developed branch of MySQL.
        : MariaDB is a multi-user, multi-threaded SQL database server.
        : It is a client/server implementation consisting of a server daemon           (mysqld)
        : and many different client programs and libraries. The base package
        : contains the standard MariaDB/MySQL client programs and generic MySQL files.

```