How to Install MySQL on AmazonLinux2023

If you are using Amazon Linux 2023 base-image, and you have tried to run yum install -y mysql, you will soon realize that it doesn’t work.

Instead install MySQL on Amazon Linux 2023 like this:

sudo dnf update -y
sudo dnf install mariadb105-server

For advanced use-cases where you are installing this in a Docker-in-Docker environment, do it without the sudo, as follows:

dnf update -y
dnf install mariadb105-server

Now if you run mysql, you will no longer get the mysql: command not found message.