Skip to content

Instantly share code, notes, and snippets.

@sshymko
Last active March 14, 2024 20:10
Show Gist options
  • Save sshymko/63ee4e9bc685c59a6ff548f1573b9c74 to your computer and use it in GitHub Desktop.
Save sshymko/63ee4e9bc685c59a6ff548f1573b9c74 to your computer and use it in GitHub Desktop.
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@MaxKavun
Copy link

superb, thanks

@alxgrk
Copy link

alxgrk commented Feb 4, 2022

As of 2022, you are required to import the latest GPG key using: sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
Thanks to @SomeCallMeTom for pointing that out in his gist.

@karthigeyanbaskaran
Copy link

sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

thanks bro, its working

@mohitthakur3
Copy link

sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

Thanks @alxgrk it's working fine.🙌🏻

@jihoon-MRX
Copy link

Thanks man

@darkn3rd
Copy link

I get:

Cannot open: https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm. Skipping.

@roycedot
Copy link

I get:

Cannot open: https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm. Skipping.

First download it manually:

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

Then install it from the locally downloaded file:

sudo yum install mysql57-community-release-el7-11.noarch.rpm

I had the same issue last week. Not sure why yum can't download it

@Agucho85
Copy link

Thanks!
It worked for Amazon Linux 2023.

@b-tin
Copy link

b-tin commented Feb 28, 2024

    const initScriptWrapper = `
      sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm; \
      sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022; \
      sudo yum install -y mysql-community-client; \
      sudo amazon-linux-extras install -y postgresql10;
    `;

Thanks, it worked for me with ami amzn2-ami-hvm-2.0.20240223.0-x86_64-gp2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment