文件首頁
MySQL 9.0 參考手冊
相關文件 下載本手冊
PDF (美式信紙) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 258.2Kb
Man Pages (Zip) - 365.3Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 參考手冊  /  ...  /  perror — 顯示 MySQL 錯誤訊息資訊

6.8.1 perror — 顯示 MySQL 錯誤訊息資訊

perror 會顯示 MySQL 或作業系統錯誤碼的錯誤訊息。 像這樣叫用 perror

perror [options] errorcode ...

perror 試圖在理解其引數時具有彈性。 例如,對於 ER_WRONG_VALUE_FOR_VAR 錯誤,perror 可以理解以下任何引數: 1231001231MY-1231MY-001231,或 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 會顯示兩個錯誤訊息

$> 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 公用程式。

系統錯誤訊息的意義可能會取決於您的作業系統。 給定的錯誤碼在不同的作業系統上可能代表不同的意思。

perror 支援以下選項。

  • --help--info-I-?

    顯示說明訊息並結束。

  • --silent-s

    靜音模式。僅列印錯誤訊息。

  • --verbose-v

    詳細模式。列印錯誤碼和訊息。這是預設行為。

  • --version-V

    顯示版本資訊並結束。