DEV Community

Installing MySQL on Amazon Linux 2023

MySQL does not come by default with Amazon Linux 2023.

I ran into some challenges installing it, and had to consult multiple blogs for success.

Follow these steps to install it.

  1. Download the RPM file
sudo wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm 
Enter fullscreen mode Exit fullscreen mode
  1. Install RPM file
sudo dnf install mysql80-community-release-el9-1.noarch.rpm -y
Enter fullscreen mode Exit fullscreen mode
  1. You need the public key of mysql to install the software.
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
Enter fullscreen mode Exit fullscreen mode
  1. If you need to install mysql client:
sudo dnf install mysql-community-client -y
Enter fullscreen mode Exit fullscreen mode

If you need server:

sudo dnf install mysql-community-server -y
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
prasanthkumar profile image
Prasanth • Edited

Thanks.. I have been trying different ways like compiling from source as well but this solution worked for me. Keep up the good work !

but still getting the issue mysql_config not found. this was fixed with dnf install mysql-community-devel. hoping it might save someones time

Collapse
 
nicowernli profile image
Nicolás Wernli

Had an issue but it works just fine! Thanks for the data!

Collapse
 
shivanisuara profile image
Shivani Suara

Thanks and kudos to you, the detailed steps helped me to install mysql DB in an amazon linux instance easily and without any hiccups ! Keep up the good work !