2012年6月19日火曜日

さくらのVPS1G移設作業 mysql(CentOS6.2)

前回の基本設定からの続きでmysqlのインストールと設定


■mysqlインストール
○なんだか設定失敗した様子でMYSQLが動かない、だいぶ嵌ったので再インストールしました。

・mysqlをアンインストール
# yum remove mysql mysql-server mysql-devel
# ll /usr/share/mysql/
# ll /var/lib/mysql/
なんだかフォルダが色々残っている。

完全クリーンインストールしたいのでフォルダごと削除してみる。
# rm -rf /usr/share/mysql
# rm -rf /var/lib/mysql

・mysqlをインストール
# yum install mysql mysql-server mysql-devel
# /etc/init.d/mysqld start
MySQL データベースを初期化中:  Installing MySQL system tables...
120607 15:44:48 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
120607 15:44:48 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
120607 15:44:48 [ERROR] Aborting

120607 15:44:48 [Note] 

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/libexec/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 mailing us!  And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!

[失敗]
起動失敗!"[ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'"とあるので完全クリーンインストールしようとして、"/usr/share/mysql"を消したのが原因か?

フォルダを確認する
# ll /usr/share/mysql/
確かに、たくさんあったディレクトリが1コも無い
"'/usr/share/mysql/english/errmsg.sys'"等一式のファイルは"mysql-libs"に含まれているっぽいので、"mysql-libs"を再インストールしてみる
# yum -reinstall mysql-libs
# ll /usr/share/mysql/
色々なフォルダが復活!
各種errmsg.sysファイルが復旧した様子!!

今までは、こんな事しなかったのだが、
きっと昔はyumで"mysql mysql-server mysql-devel"を再インストールすると依存関係でmysql-libsも再インストールされていたが途中から変わったのかな?
とにかく随分ハマッてしまった。

気を取り直してmysql起動
# /etc/init.d/mysqld restart
mysqld を停止中:  [  OK  ]
MySQL Daemon failed to start.
mysqld を起動中:  [失敗]
またも起動失敗_| ̄|○
ログに以下の記述を発見
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

と言うことで以下を実行する。
# mysql_install_db
# /etc/init.d/mysqld start
mysqld を起動中:  [  OK  ]
起動成功!!!
これでようやくmysqlが初期状態になったはず

0 件のコメント:

コメントを投稿