EC2(Amazon Linux )へのmysql-shellのインストールがなかなか上手く行かず困ったので、上手くいったインストールコマンドをメモ書きします。
※ 2025/01/31時点では次のコマンドでは上手くインストールできなくなりました
# mysqlのリポジトリ追加
sudo rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# GPGをimportする(2022,2023)
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
# mysql-shellコマンドのインストール(mysqlsh)
sudo yum install mysql-shell
2025/01/31追記:上記では上手くいかないので...
EC2(Amazon Linux 2023)へのインストールが上手く行えなくなりました。。
sh-5.2$ sudo yum install mysql-shell
Last metadata expiration check: 0:03:27 ago on Fri Jan 31 02:28:10 2025.
Error:
Problem: conflicting requests
- nothing provides libpython2.7.so.1.0()(64bit) needed by mysql-shell-1.0.10-1.el7.x86_64 from mysql-tools-community
- nothing provides libpython2.7.so.1.0()(64bit) needed by mysql-shell-1.0.11-1.el7.x86_64 from mysql-tools-community
- nothing provides libpython2.7.so.1.0()(64bit) needed by mysql-shell-1.0.9-1.el7.x86_64 from mysql-tools-community
- nothing provides libcrypto.so.10()(64bit) needed by mysql-shell-8.0.11-1.el7.x86_64 from mysql-tools-community
色々調べたところ、下記コマンドでインストールできました。
sudo dnf -y install https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm
sudo dnf -y install mysql mysql-community-client
# mysql-shellを利用するだけなら下記は不要
# sudo dnf -y install mysql-community-server
参考:https://dev.classmethod.jp/articles/Install-mysql-on-al2023-and-login