MySQLのエラーログにこんなエラーが出ていたとします。
150819 10:05:09 [ERROR] Slave I/O: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master. Error: , Error_code: 1159
エラーメッセージは読めば良いとして、 Error_code: 1159
これの意味が分からない。
そういうときは、ドキュメントを見れば良いという話もありますが、いちいちブラウザ開くのめんどうくさい。
- MySQL :: MySQL 5.6 Reference Manual :: B.3 Server Error Codes and Messages
- MySQL :: MySQL 5.6 Reference Manual :: B.4 Client Error Codes and Messages
そういうときは perror
コマンドを使ってあげるとよいでしょう。
% perror 1159 MySQL error code 1159 (ER_NET_READ_INTERRUPTED): Got timeout reading communication packets
なるほど、接続がtimeoutしたのかというのが分かったりします。
そんな地味な perror
コマンドでした。
MySQLにはperrorという地味なコマンドがありましてね。
エラーコード出力されてるけどよく分からないと言うときこんな風に打ってあげるとたまに便利。 `perror 1159`
— masasuzu? (@masasuz) August 19, 2015
追記
2年前同じような記事書いてたことを今思い出した。