Amazon Linux 2 come with MariaDB by default. To install MySQL 5.7, install repository with
sudo rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Install MySQL 5.7 with
sudo yum install mysql-community-server
Set MySQL to start on boot
sudo systemctl enable mysqld
Start MySQL server
sudo systemctl start mysqld
By default MySQL 5.7 installation generate a temporary password. To find the password, run
sudo grep "password" /var/log/mysqld.log
To set password and secure the installation, run
sudo mysql_secure_installation
See Amazon Linux
Leave a Reply