Installing MySQL on Amazon Linux 2023
Manu Muraleedharan

Manu Muraleedharan @manumaan

About: AWS Community Builder

Joined:
Apr 6, 2023

Installing MySQL on Amazon Linux 2023

Publish Date: Feb 15 '24
96 5

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

Comments 5 total

  • Shivani Suara
    Shivani SuaraApr 30, 2024

    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 !

  • Prasanth
    PrasanthMay 29, 2024

    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

  • Nicolás Wernli
    Nicolás WernliDec 12, 2024

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

  • Pratima Tiwari
    Pratima TiwariMar 17, 2025

    I was facing issue installing mysql. This has worked perfectly. Thank you for sharing!

  • yashwanth s
    yashwanth sMay 28, 2025

    Actually i followed this way:

    To install the MySQL client on Amazon Linux 2023:

    1. sudo dnf install -y dev.mysql.com/get/mysql80-communit...
      This is for MySQL 8.0 and EL9 (Amazon Linux 2023 is based on Fedora/RHEL 9)

    2. sudo dnf install -y mysql-community-client --nogpgcheck
      This will allow you to install the MySQL client despite the GPG issue.

    3. After Installation
      mysql --version

Add comment