【MySQL】起動失敗 MySQL Daemon failed to start.

AWSにサイトを構築中

最初、MySQL5.6をインストールしたんだけど

postfixやdovecotを入れようと思ったら

↓こんなエラーが出て、インストールに失敗する
どうやら、 MySQL5.5のものと競合するとかで怒られてるらしい

file /usr/lib64/mysql/libmysqlclient.so.18 from install of mysql55-libs-5.5.45-1.9.amzn1.x86_64 conflicts with file from package mysql-community-libs-5.6.27-2.el6.x86_64

がんばってみたけれど、ボクには解決できず

納得いかないけど、渋々MySQLを5.5にダウングレード。。。

そん時に、MySQL5.5を起動しようとしたら

エラーが出たので、対処方法をメモメモ

普通に起動しようと思ったら、エラーになったよ?!

# /etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

とりあえずログ確認

# tail -n 30 /var/log/mysqld.log
151002 11:17:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151002 11:17:34 [Note] /usr/sbin/mysqld (mysqld 5.5.46) starting as process 10605 ...
151002 11:17:34 [Note] Plugin 'FEDERATED' is disabled.
151002 11:17:34 InnoDB: The InnoDB memory heap is disabled
151002 11:17:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151002 11:17:34 InnoDB: Compressed tables use zlib 1.2.3
151002 11:17:34 InnoDB: Using Linux native AIO
151002 11:17:34 InnoDB: Initializing buffer pool, size = 128.0M
151002 11:17:34 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
151002 11:17:34 [ERROR] Plugin 'InnoDB' init function returned error.
151002 11:17:34 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151002 11:17:34 [ERROR] Unknown/unsupported storage engine: InnoDB
151002 11:17:34 [ERROR] Aborting

151002 11:17:34 [Note] /usr/sbin/mysqld: Shutdown complete

151002 11:17:34 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

どうやら以前のバージョンのib_logfile0ファイルの
残骸があるようで、怒られている模様。。。

とりあえず、/var/lib/mysql/にあった
ib_logfile0、ib_logfile1を削除してから

もっかい起動を試みる、、、

まだエラー、、、

次のメッセージは

151002 11:31:02 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
151002 11:31:02 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

う~ん、DBの場所がみつけられないといっている模様

ググって探した、下記のコマンドを投げてみる

# mysql_install_db --datadir=/var/lib/mysql --user=mysql
Installing MySQL system tables...
151002 11:38:44 [Note] /usr/sbin/mysqld (mysqld 5.5.46) starting as process 11073 ...
151002 11:38:44 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/tables_priv.frm'
ERROR: 1033  Incorrect information in file: './mysql/tables_priv.frm'
151002 11:38:44 [ERROR] Aborting

151002 11:38:44 [Note] /usr/sbin/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before submitting a bug report
at http://bugs.mysql.com/

あれっ、これも失敗。

やばい、ハマりそうな予感。。。

よくわかんないので、もっかいMySQLの起動!

151002 11:50:43 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
151002 11:50:43 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
151002 11:50:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

エラーメッセージが変わったーっ!!

どうやら、host.frmの所有者がrootなのが問題?!

cd /var/lib/mysql/mysql
chown mysql:mysql host.frm host.MYD host.MYI

うりゃー、もっかい起動ー!!

151002 11:55:18 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/proxies_priv.frm'
151002 11:55:18 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/proxies_priv.frm'
151002 11:55:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

でたー、エラーっ!

ファイル削除!

rm /var/lib/mysql/mysqlproxies_priv.frm

無事、起動成功!

コメント

タイトルとURLをコピーしました