InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
MySQL 5.6をインストールし起動を試みたら、起動できませんでした。
MySQL起動エラー
エラーメッセージ
MySQLの起動を試みた結果、エラーメッセージが表示された。
# service mysqld start MySQL データベースを初期化中: 2015-03-05 06:11:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-03-05 06:11:12 768 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-03-05 06:11:12 768 [Note] InnoDB: The InnoDB memory heap is disabled 2015-03-05 06:11:12 768 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-03-05 06:11:12 768 [Note] InnoDB: Memory barrier is not used 2015-03-05 06:11:12 768 [Note] InnoDB: Compressed tables use zlib 1.2.3 2015-03-05 06:11:12 768 [Note] InnoDB: Using Linux native AIO 2015-03-05 06:11:12 768 [Note] InnoDB: Using CPU crc32 instructions 2015-03-05 06:11:12 7f957bff5720 InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 attempts before giving up. InnoDB: Warning: io_setup() attempt 1 failed. InnoDB: Warning: io_setup() attempt 2 failed. InnoDB: Warning: io_setup() attempt 3 failed. InnoDB: Warning: io_setup() attempt 4 failed. InnoDB: Warning: io_setup() attempt 5 failed. 2015-03-05 06:11:15 7f957bff5720 InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts. InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf 2015-03-05 06:11:15 768 [ERROR] InnoDB: Fatal : Cannot initialize AIO sub-system 2015-03-05 06:11:15 768 [ERROR] Plugin 'InnoDB' init function returned error. 2015-03-05 06:11:15 768 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2015-03-05 06:11:15 768 [ERROR] Unknown/unsupported storage engine: InnoDB 2015-03-05 06:11:15 768 [ERROR] Aborting 2015-03-05 06:11:15 768 [Note] Binlog end 2015-03-05 06:11:15 768 [Note] /usr/sbin/mysqld: Shutdown complete [失敗]
エラーメッセージには、「my.cnf」へ「innodb_use_native_aio = 0」を設定しなさいと書いてある。
エラーメッセージに従い、「my.cnf」へ設定を追加します。
# sed -i 's/^\[mysqld\]/\[mysqld\]\ninnodb_use_native_aio = 0/g' /etc/my.cnf
ログを確認
MySQLのログを確認します。
2015-03-05 06:26:52 1867 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
ログには、別のエラーメッセージが表示されていました。 エラーメッセージの内容から、データベースの初期化に失敗しているようです。
データベースを手動で初期化します。
# /usr/bin/mysql_install_db --datadir=/var/lib/mysql --user=mysql
動作確認
ひと通り、エラーメッセージが出力されなくなったのであらためて再起動させてみます。
# service mysqld start
無事に起動できるようになりました。