MySQL > エラーと対策
更新日
2015-01-03
広告
MySQLのエラーと対策について紹介します。
ERROR 1194
mysqlデータベースのuserテーブルの情報を参照しようとしたら、以下のエラーが出ました。ERROR 1194 (HY000): Table 'user' is marked as crashed and should be repairedこのエラーを修復するためには、myisamchkコマンドを利用します。
root# myisamchk --silent --force --fast --update-state -variable-name=value /usr/local/mysql/db/*/*.MYI/usr/local/mysql/dbの部分は、データファイルが保存されているディレクトリを指定してください。
InnoDB log file error
MySQLのログファイル /var/log/mysql/error.log に以下のエラーが出ました。InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 536870912 bytes!このエラーは、設定ファイル(my.cnfなど)中の以下の設定が原因です。
innodb_log_file_size = 512Mこの設定値と実際のログファイルのサイズが異なってしまっていることが問題です。 一番簡単な修正方法は、MySQLを停止して、/var/lib/mysql 以下の ib_logfile0 とib_logfile1 を削除(もしくは別名保存)する方法です。 これでMySQLを再起動すると、以下のようにログファイルが再作成されます。
InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 512 MB
広告
お問い合わせは sweng.tips@gmail.com まで。