Amazon Linux2にMysqlClientをインストールする方法です。
対象はEC2 Amazon linux2のx86/64です。
sudo yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo yum-config-manager --disable mysql57-community
sudo yum-config-manager --enable mysql80-community
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo yum install mysql-community-client
鍵が古いと警告が出るようですので、rpm --import
が必要なようです。
[ec2-user@hogehoge-ec2 ~]$ mysql --version
mysql Ver 8.0.31 for Linux on x86_64 (MySQL Community Server - GPL)
以下を参考にさせていただきました。