Help us understand the problem. What is going on with this article?

[Amazon Workspaces]mysqlclientのインストール

環境

Amazon WorkSpaces
Amazon Linux release 2 (Karoo)

注意事項

Amazon WorkSpacesの環境は、最初からMariaDB 5.5が入っています。
削除しようとすると途中で落ちて接続できなくなり、Workspacesの
再構築が必要なります。

インストール

# Python3のインストール
sudo yum install python3
cd
python3 -m venv ~/myvenv/

# mariadb.repo追加
$ sudo tee /etc/yum.repos.d/MariaDB.repo <<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

# python3-devel MariaDB-devel MariaDB-sharedのインストール
# Python2を使う場合は、python3-develではなくpython-develをインストール
$ sudo yum install -y python3-devel MariaDB-devel MariaDB-shared

$ yum list installed | grep mariadb

MariaDB-common.x86_64                 10.4.12-1.el7.centos           @mariadb   
MariaDB-compat.x86_64                 10.4.12-1.el7.centos           @mariadb   
MariaDB-devel.x86_64                  10.4.12-1.el7.centos           @mariadb   
MariaDB-shared.x86_64                 10.4.12-1.el7.centos           @mariadb   

# 仮想環境に切り替え
source ~/myvenv/bin/activate

# mysqlclient
pip install mysqlclient

参考URL

mysqlclient
Python3でMariaDB(MySQL)に接続する方法
jessieからstretchへのアップデートでlibmysqlclient-devはdefault-libmysqlclient-devへと生まれ変わったのだ...
CentOS環境でMariaDB利用するのためにmysqlclientでインストールする方法
Django: macOSでのpip install mysqlclient エラーの解決法
CentOS7でmysqlclientがインストールできない
【Python】mysqlclientをpipでインストールしようとしたら躓いた話
Ubuntuでmysqlclientのインストールに失敗する。
pip install mysqlclientのエラーerror: command ‘gcc’ failed with exit status 1の直し方

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした