Skip to content

Instantly share code, notes, and snippets.

@qinjie
Forked from sshymko/install_mysql_client.sh
Created October 5, 2022 02:14
Show Gist options
  • Save qinjie/edfb5ca32fffa9b146ee9010325f2a92 to your computer and use it in GitHub Desktop.
Save qinjie/edfb5ca32fffa9b146ee9010325f2a92 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
@qinjie
Copy link
Author

qinjie commented Oct 5, 2022

Amazon Linux recommends MariaDB instead.

Install MariaDB-Client

sudo yum -y update
curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo bash mariadb_repo_setup --os-type=rhel  --os-version=7 --mariadb-server-version=10.7
sudo rm -rf /var/cache/yum
sudo yum makecache
sudo yum install MariaDB-client

Use it to connect to MySQL server.

mysql -h <HOST> -P <PORT> -u <USER> -p

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