MySQLでブートファイルを開くことができません。

MySQLでブートファイルを開くことができません。

RH / Oracle Linux用MySQLバージョン5.7.10をインストールした後、初期化中にブートストラップファイルが見つからないというエラーが発生します。新しくインストールしたもので、バグがまだ解決されていないので、これがどこで発生するのかよくわかりません。

インストーラがこのフォルダの権限を正しく設定しました。

# ls -l /var/lib | grep mysql-files
drwxr-x---. 2 mysql         mysql         4096 Dec  8 15:13 mysql-files

mysqld.log:

2015-12-08T14:13:24.524728Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-12-08T14:13:26.107212Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-12-08T14:13:26.440941Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-12-08T14:13:26.612704Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: d95e041f-9db5-11e5-a33f-525400eb9be6.
2015-12-08T14:13:26.650484Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-12-08T14:13:26.668489Z 1 [Note] A temporary password is generated for root@localhost: YZ+#zIY/m2=:
2015-12-08T14:13:39.994706Z 1 [ERROR] Failed to open the bootstrap file /var/lib/mysql-files/install-validate-password-plugin.OFJRaf.sql
2015-12-08T14:13:39.994728Z 1 [ERROR] 1105  Bootstrap file error, return code (0). Nearest query: 'LSE SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM `', in_db, '`.`', in_table, '`'); PREPARE stmt_select FROM @sys.tmp.table_exists.SQL; IF (NOT v_error) THEN DEALLOCATE PREPARE stmt_select; SET out_exists = 'TEMPORARY'; END IF; END IF; END;
'
2015-12-08T14:13:39.994880Z 0 [ERROR] Aborting

ベストアンサー1

Oracleリポジトリからmysql-community-serverのインストール中にこのエラーが発生しました。

mysqld_safewith 文を実行してパスワードをリセットすると、問題が解決します。変じゃないですか?

/tmp/mysql-init.txt:

UPDATE mysql.user SET authentication_string = PASSWORD('p@ssw0rd')
WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;

開始mysqld_safe:

mysqld_safe --init-file=/tmp/mysql-init.txt

新しいパスワードを設定したことを確認してください。

service mysqld stop
service mysqld start
chkconfig mysqld on

mysql CLIを使用してルートのパスワードをテストします。

mysql -u root -p

おすすめ記事