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可以理解以下任何参数:1231
、001231
、MY-1231
或MY-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支持以下选项。
Display a help message and exit.显示帮助消息并退出。
Print the error message for a MySQL Cluster error code.打印MySQL Cluster错误代码的错误消息。
This option was removed in MySQL 8.0.13. Use the ndb_perror utility instead.MySQL 8.0.13中删除了此选项。请改用ndb_perror实用程序。
--silent
, -s
Silent mode. Print only the error message.静音模式。仅打印错误消息。
--verbose
, -v
Verbose mode. Print error code and message. This is the default behavior.详细模式。打印错误代码和消息。这是默认行为。
--version
, -V
Display version information and exit.显示版本信息并退出。