- perror — Explain Error Codes
今まで、mysqlのエラーコードの内容を調べるために下記のドキュメントとかを漁っていたんですが、perrorを使うと、コマンドラインでエラーコードの内容が参照できるみたいです。
- C.3. Server Error Codes and Messages
- C.4. Client Error Codes and Messages
なんてことは無いけど、これはちょっとだけ捗るかもしれない。
どうでもいいけど、perror(3)と名前がかぶってるな。。。
% perror --help perror Ver 2.11, for Linux (i686) This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Print a description for a system error code or a MySQL error code. If you want to get the error for a negative error code, you should use -- before the first error code to tell perror that there was no more options. Usage: perror [OPTIONS] [ERRORCODE [ERRORCODE...]] -?, --help Displays this help and exits. -I, --info Synonym for --help. -a, --all Print all the error messages and the number. Deprecated, will be removed in a future release. -s, --silent Only print the error message. -v, --verbose Print error code and message (default). (Defaults to on; use --skip-verbose to disable.) -V, --version Displays version information and exits. Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ---------------------------------------- all FALSE verbose TRUE % perror 1153 1159 MySQL error code 1153 (ER_NET_PACKET_TOO_LARGE): Got a packet bigger than 'max_allowed_packet' bytes MySQL error code 1159 (ER_NET_READ_INTERRUPTED): Got timeout reading communication packets % perror 1154 MySQL error code 1154 (ER_NET_READ_ERROR_FROM_PIPE): Got a read error from the connection pipe