GA

2015/03/12

MySQL 5.7.6でmysql_install_db(とmysqld --initialize)がSSL証明書のファイルを作っているぽいのであとで調べたい

MySQL 5.7.5のmysql_install_dbだと


$ bin/mysql_install_db --no-defaults --basedir=./ --datadir=./test_575 -v
2015-03-12 11:23:45 [NOTE]    Creating data directory ./test_575
2015-03-12 11:23:45 [NOTE]    Generating random password to /root/.mysql_secret...done.
2015-03-12 11:23:45 [NOTE]    Executing /opt/mysql/5.7.5/bin/mysqld --no-defaults --bootstrap --datadir=./test_575 --lc-messages-dir=./share --lc-messages=en_US --basedir=.
2015-03-12 11:23:46 [NOTE]    Creating system tables...done.
2015-03-12 11:23:46 [NOTE]    Filling system tables with data...done.
2015-03-12 11:23:47 [NOTE]    Filling help table with data...done.
2015-03-12 11:23:47 [NOTE]    Creating default user root@localhost
2015-03-12 11:23:47 [NOTE]    Creating default proxy root@localhost
2015-03-12 11:23:48 [NOTE]    Success!

.mysql_secretを作ってシステムテーブルを作ってroot@localhostを作るだけだったのが、5.7.6のmysql_install_dbでは


$ bin/mysql_install_db --no-defaults --basedir=./ --datadir=./test_mysql_install_db -v
2015-03-12 11:25:04 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2015-03-12 11:25:04 [NOTE]    Creating data directory ./test_mysql_install_db
2015-03-12 11:25:04 [NOTE]    Generating random password to /home/ttanaka/.mysql_secret...done.
2015-03-12 11:25:04 [NOTE]    Executing /usr/mysql/5.7.6/bin/mysqld --no-defaults --bootstrap --datadir=./test_mysql_install_db --lc-messages-dir=./share --lc-messages=en_US --basedir=.
2015-03-12 11:25:06 [NOTE]    Creating system tables...done.
2015-03-12 11:25:06 [NOTE]    Filling system tables with data...done.
2015-03-12 11:25:07 [NOTE]    Filling help table with data...done.
2015-03-12 11:25:07 [NOTE]    Creating default user root@localhost
2015-03-12 11:25:07 [NOTE]    Creating default proxy root@localhost
2015-03-12 11:25:07 [WARNING] The bootstrap log isn't empty:
2015-03-12 11:25:07 [WARNING] mysqld:
2015-03-12 11:25:07 [NOTE]    Generating SSL Certificates
OpenSSL 1.0.1e-fips 11 Feb 2013
server-cert.pem: OK
client-cert.pem: OK

$ ll test_mysql_install_db
合計 110640
-rw------- 1 mysql mysql     1679  3月 12 11:25 2015 ca-key.pem
-rw-r--r-- 1 mysql mysql     1082  3月 12 11:25 2015 ca.pem
-rw-r--r-- 1 mysql mysql     1086  3月 12 11:25 2015 client-cert.pem
-rw------- 1 mysql mysql     1679  3月 12 11:25 2015 client-key.pem
-rw-r----- 1 mysql mysql 50331648  3月 12 11:25 2015 ib_logfile0
-rw-r----- 1 mysql mysql 50331648  3月 12 11:25 2015 ib_logfile1
-rw-r----- 1 mysql mysql 12582912  3月 12 11:25 2015 ibdata1
drwxr-x--- 2 mysql mysql     4096  3月 12 11:25 2015 mysql
drwxr-x--- 2 mysql mysql     4096  3月 12 11:25 2015 performance_schema
-rw------- 1 mysql mysql     1675  3月 12 11:25 2015 private_key.pem
-rw-r--r-- 1 mysql mysql      451  3月 12 11:25 2015 public_key.pem
-rw-r--r-- 1 mysql mysql     1086  3月 12 11:25 2015 server-cert.pem
-rw------- 1 mysql mysql     1679  3月 12 11:25 2015 server-key.pem

そのあとにサーバー用, クライアント用のSSL証明書を作っているぽい。
( ´-`).oO(mysqld: で止まってるワーニングメッセージがあるんだけど、これ MeCabのやつ と一緒でOpenSSLのライブラリーから戻ってきた何かをうまくハンドルできてないんじゃないか。。

そして5.7.6のmysqld --initialize。


$ bin/mysqld --no-defaults --initialize-insecure --datadir=./test_mysqld --log-error-verbosity=3
2015-03-12T02:25:54.901505Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-12T02:25:54.901602Z 0 [Note] Ignoring --secure-file-priv value as server is running with --initialize(-insecure) or --bootstrap.
2015-03-12T02:25:54.901846Z 0 [Note] bin/mysqld (mysqld 5.7.6-m16) starting as process 23958 ...
2015-03-12T02:25:54.938092Z 0 [Note] Creating the data directory /usr/mysql/5.7.6/test_mysqld/
..
2015-03-12T02:25:56.202015Z 0 [Note] Plugin 'FEDERATED' is disabled.
2015-03-12T02:25:56.202631Z 0 [Warning] Failed to setup SSL
2015-03-12T02:25:56.202643Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key
2015-03-12T02:25:56.203497Z 1 [Note] Creating the system database
2015-03-12T02:25:56.203521Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2015-03-12T02:25:56.204099Z 1 [Note] Creating the system tables
2015-03-12T02:25:57.234370Z 1 [Note] Filling in the system tables, part 1
2015-03-12T02:25:57.235332Z 1 [Note] Filling in the system tables, part 2
2015-03-12T02:25:57.235347Z 1 [Note] Filling in the mysql.help table
2015-03-12T02:25:57.969635Z 1 [Note] Bootstrapping complete
2015-03-12T02:25:57.969924Z 0 [Note] Giving 0 client threads a chance to die gracefully
2015-03-12T02:25:57.969945Z 0 [Note] Shutting down slave threads
2015-03-12T02:25:57.969955Z 0 [Note] Forcefully disconnecting 0 remaining clients
2015-03-12T02:25:57.970165Z 0 [Note] Binlog end
2015-03-12T02:25:57.970630Z 0 [Note] InnoDB: FTS optimize thread exiting.
2015-03-12T02:25:57.970950Z 0 [Note] InnoDB: Starting shutdown...
2015-03-12T02:25:59.100867Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2321861
2015-03-12T02:25:59.104330Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"

$ ll test_mysqld/
合計 110604
-rw-r----- 1 mysql mysql 50331648  3月 12 11:25 2015 ib_logfile0
-rw-r----- 1 mysql mysql 50331648  3月 12 11:25 2015 ib_logfile1
-rw-r----- 1 mysql mysql 12582912  3月 12 11:25 2015 ibdata1
drwxr-x--- 2 mysql mysql     4096  3月 12 11:25 2015 mysql
drwxr-x--- 2 mysql mysql     4096  3月 12 11:25 2015 performance_schema

同じくなんかSSL証明書を作ろうとしてるけど失敗してる。全く同じ動作ってわけではないぽい。ちょっと調べようか。


【2015/03/13 13:36】
調べてみたところ、作ろうとしているのではなく、使おうとして(証明書がないので)失敗しているのであった。
日々の覚書: MySQL 5.7.6からSSL周りのセットアップが扱いやすくなった

0 件のコメント :

コメントを投稿