0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQL 5.7 で ssl 対応 (Ubuntu 16.04)

Posted at

mysql_ssl_rsa_setup

mysql_ssl_rsa_setup

で /var/lib/mysql に 各pem ファイルが自動的に作成される。

※--datadir オプションでディレクトリ指定可能
※ 各pem ファイルのパーミッションで「読み取り」を付加

my.cnf を編集

/etc/mysql/my.cnf

[mysqld]
・・・
datadir=/var/lib/mysql/mypath
・・・
ssl-ca=/var/lib/mysql/mypath/ca.pem
ssl-cert=/var/lib/mysql/mypath/server-cert.pem
ssl-key=/var/lib/mysql/mypath/server-key.pem
・・・

専用ユーザ作成

mysql> create user 'ユーザ名' identified by 'パスワード';

権限設定

mysql> grant all privileges on . to 'ユーザ名' identified by 'パスワード' require ssl;

設定確認

mysql -u ユーザ名 -p --ssl-ca=/var/lib/mysql/mypath/ca.pem;

mysql> show variables like '%ssl%;

で確認。

tcpdump -n -X -s 2000 port 3306 -i インターフェース

でパケット確認。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?