8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 6 个 MySQL 程序 / 6.8 杂项程序 / 6.8.1 perror——显示 MySQL 错误信息信息
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 73%

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

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

perror [options] errorcode ...

perror 尝试在理解其参数时保持灵活。例如,对于 ER_WRONG_VALUE_FOR_VAR 错误,perror 可以理解以下任一参数:1231、001231、MY-1231 或 MY-001231,或 ER_WRONG_VALUE_FOR_VAR。perror attempts to be flexible in understanding its arguments. 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.

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

如果错误编号处于 MySQL 与操作系统错误重叠的范围内,perror 会显示两个错误信息:If an error number is in the range where MySQL and operating system errors overlap, perror displays both error messages:

$> 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)

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

系统错误消息的含义可能取决于您的操作系统。同一个错误代码在不同的操作系统上可能意味着不同的事情。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 支持以下选项。perror supports the following options.

  • --help, --info, -I, -?

    显示帮助信息并退出。Display a help message and exit.

  • --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.