4.8.2 perror — Display MySQL Error Message Information显示MySQL错误消息信息

perror displays the error message for MySQL or operating system error codes. Invoke perror like this:perror显示MySQL或操作系统错误代码的错误消息。像这样调用perror

perror [options] errorcode ...

perror attempts to be flexible in understanding its arguments. perror试图灵活地理解其论点。For example, for the ER_WRONG_VALUE_FOR_VAR error, perror understands any of these arguments: 1231, 001231, MY-1231, or MY-001231, or ER_WRONG_VALUE_FOR_VAR.例如,对于ER_WRONG_VALUE_For_VAR错误,perror可以理解以下任何参数:1231001231MY-1231MY-001231,或ER_WRONG_VALUE_FOR_VAR

shell> perror 1231
MySQL error code MY-001231 (ER_WRONG_VALUE_FOR_VAR): Variable '%-.64s'
can't be set to the value of '%-.200s'

If an error number is in the range where MySQL and operating system errors overlap, perror displays both error messages:如果错误号在MySQL和操作系统错误重叠的范围内,perror将显示两条错误消息:

shell> perror 1 13
OS error code   1:  Operation not permitted
MySQL error code MY-000001: Can't create/write to file '%s' (OS errno %d - %s)
OS error code  13:  Permission denied
MySQL error code MY-000013: Can't get stat of '%s' (OS errno %d - %s)

To obtain the error message for a MySQL Cluster error code, use the ndb_perror utility.要获取MySQL Cluster错误代码的错误消息,请使用ndb_perror实用程序。

The meaning of system error messages may be dependent on your operating system. A given error code may mean different things on different operating systems.系统错误消息的含义可能取决于您的操作系统。给定的错误代码在不同的操作系统上可能意味着不同的事情。

perror supports the following options.perror支持以下选项。