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:

1
2
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:

1
2
dnf update -y
dnf install mariadb105-server

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