Skip to content

Instantly share code, notes, and snippets.

@sshymko
Last active March 14, 2024 20:10
Show Gist options
  • Star 58 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • 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
@sshymko
Copy link
Author

sshymko commented Feb 17, 2019

@siddharthbarman
Copy link

Worked for me, thanks!

@sshymko
Copy link
Author

sshymko commented Sep 28, 2020

@fosstechnix
Please stop posting spam comments with broken links to your website duplicating the official MySQL docs.
Moreover, this Gist is about installation of MySQL client, not MySQL server.
Deleted your comment once again.

@sionsmith
Copy link

👍

@ideviant
Copy link

ideviant commented Mar 4, 2021

great!

@maqboolp
Copy link

thanks

@bdforbes
Copy link

bdforbes commented Apr 8, 2021

Thanks @sshymko, this worked for me. Why do we need both commands? I had tried the second command previously and got issues with GLIBC versions; but now after running the first command, everything works!

@sshymko
Copy link
Author

sshymko commented Apr 8, 2021

@bdforbes
The first command adds an RPM repository to install the MySQL client along with all its dependencies from.

@bdforbes
Copy link

bdforbes commented Apr 9, 2021

Thanks, I didn't realise that's how yum works.

@SomeCallMeTom
Copy link

@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