Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.9Mb
PDF (A4) - 37.9Mb
PDF (RPM) - 32.9Mb
HTML Download (TGZ) - 8.0Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.7Kb
Man Pages (Zip) - 189.0Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  perror — Explain Error Codes

4.8.2 perror — Explain Error Codes

perror displays the error message for MySQL or operating system error codes. Invoke perror like this:

shell> perror [options] errorcode ...

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.

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:

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, invoke perror with the --ndb option:

shell> perror --ndb errorcode

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.

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

    Display a help message and exit.

  • --ndb

    Print the error message for a MySQL Cluster error code.

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

User Comments
  Posted by Dan Ross on June 3, 2003
Regarding list of MySQL errors.

If you use unix, you can generate the list with the command:
perror `seq a b`
where a is the first error code and b is the last error code you want to list.
For example,
perror `seq 0 10`
shows codes 0 through 10.
  Posted by Adrian Pitman on November 3, 2003
In Windows you will find perror in 'mysql\bin'

from the command line in this directory run the program with your error code;

perror.exe 2

This will return the results;
Error Code 2: No such file or directory
  Posted by on January 12, 2004
To generate an error list if you don't have the seq command on your system, and you do have perl:

perror `perl -e "print join ' ',1..100"`

Where 1 is the first error number, and 100 is the last error number you want to see (similar to seq).
  Posted by Philip Olson on February 13, 2004
The error return codes are listed here:
Although the messages aren't listed (yet?). See also the following bug report (and don't hesitate to vote!):
Sign Up Login You must be logged in to post a comment.