MySQL 9.0 發行說明
perror 會顯示 MySQL 或作業系統錯誤碼的錯誤訊息。 像這樣叫用 perror
perror [options] errorcode ...
perror 試圖在理解其引數時具有彈性。 例如,對於 ER_WRONG_VALUE_FOR_VAR
錯誤,perror 可以理解以下任何引數: 1231
、001231
、MY-1231
或 MY-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 支援以下選項。