How to install MySQL8 on Amazon Linux2

This tutorial explains the steps to install MySQL8 on Amazon Linux2 EC2 instance.

Step1: Login to the instance via ssh and switch as root user.

Step2: Add MySQL yum repository.

#yum install

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.


Follow the standard input requirements and complete the installation.

That's all…

Leave a Reply