How to install MySQL 5.7 on Amazon Linux
The Amazon Linux repositories contains Mariadb packages instead of MySQL by default.
This tutorial explains the steps to install MySQL 5.7 on Amazon Linux.
Step1: Login to the instance via ssh and switch to root user.
Step2: Install MySQL yum repository.
#rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Step3: Install MysQL.
#yum install mysql-community-server
Step4: Enable MySQL to run in startup.
#systemctl enable mysqld
Step5: Start MySQL service.
#systemctl start mysqld
Step6: Collect the auto generated root password from MySQL log file.
#grep 'temporary password' /var/log/mysqld.log
Step7: Complete the post installation setup.
#mysql_secure_installation
Follow the standard input requirements and complete the installation.
That's all…