MySQL SSL接続(SSL必須)

サーバ側

# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10281
Server version: 5.5.15-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> grant all on test.* to test@’client.example.com’ identified by ‘XXXXXX’ require ssl;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

クライアント側

% mysql -u test -h master.example.com -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘test’@’master.example.com’ (using password: YES)
%mysql -u test -h master.example.com -p –ssl-ca=/var/lib/mysql/example_root.crt –ssl-verify-server-cert
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10323
Server version: 5.5.15-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> \q
Bye