Bug #531 add a list of error numbers
Submitted: 29 May 2003 1:07 Modified: 19 Feb 2004 15:01
Reporter: Ralf Hauser Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:any OS:Any (any)
Assigned to: Sergei Golubchik CPU Architecture:Any

[29 May 2003 1:07] Ralf Hauser
when trying to -e "source script.sql", I get "ERROR 1064"
Trying to search the mysql.com site unfortunately doesn't yield a useful result.

How to repeat:
The underlying cause for this is not relevant to this suggestion since it applies to any error that could occur here

Suggested fix:
Provide a listing of all error numbers that
- contains a short and meaningful error text beyond the 
<<ERROR #### at line XY in file: 'script.sql': You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line Z>> that doesn't help much.
- a description about the most likely causes for this error
- links to detailed descriptions how to prevent the most common causes
- a "last resort" link into the bug database

Having this would really speed up the development and save a lot of people a lot of time!! Many thanks in advance!
[29 May 2003 1:27] Ralf Hauser
http://lists.mysql.com/list.php?1:mss:85336:200109:jpfmopnilfiimklcggii asks for this too
[13 Feb 2004 9:08] Philip Olson
This bug report is partially resolved here (all error codes are listed, but without descriptions):

  * http://www.mysql.com/doc/en/Error-returns.html

In the very least that page should include text from errmsg.sys.  Error-returns.html eludes to this file but many people don't have access to it.

Error messages should be listed within that page OR more likely live within its own page (with the two heavily linked).  Whether that be perror.html or a new page like Error-messages.html I don't know.  Also, Error-returns.html should link to perror.html regardless of how this bug report is resolved.

perror.html ends with this text: "Note that the error messages are mostly system dependent!", which is fine, but since the codes are listed why not also list the messages too?  I'm sure people would be okay with this note/warning alongside messages from the "most common system".

Initially this bug report asked for a lot but I think adding the descriptions would be enough, and interlinking to perror.html.  About the only error that "deserves" an explanation are syntax errors (this question comes up a lot, people want to know why they are getting a syntax error) but of course syntax is  just syntax, I guess the error message for that could end with "LEARN SQL!!" :)

Note: Strange this bug report lacks a "status", it's just blank.  Could someone fix that? :)
[19 Feb 2004 10:57] Paul Dubois
I am un-assigning this from the docs team after
discussing the issue with the other team members.
Here's why:

A deeper problem that lies deeper than listing the
errors in the manual is that the error-reporting
function that is supposed to be served by perror does
not work in many cases. There are a lot of errors for
which it reports "unknown error".  So:

- If perror cannot tell what an error means, docs cannot,

- When the error reporting mechanism used by perror
works properly, docs can use the same source of
information used by perror to improve the documentation.
(Of course, if perror worked better, documentation of
the error codes would be less needed, but that's another
[19 Feb 2004 15:01] Sergei Golubchik
perror is a different issue. It will fixed of course.
Meanwhile after discussing the issue with Arjen, I'm adding a list of error numbers and appropriate messages to the manual
[29 Oct 2004 1:54] Cyber identity

I have what i think is a bug.


My enviroment is 

Windows 2000 server
PHP 4.9
Latest Mysql

It has amajor problem connecting to the mysql database and i have followed many install advice.

IF you have any questions please mail me.


[20 Nov 2012 14:58] Sheeri Cabral
These days, the "partial resolution" given by http://www.mysql.com/doc/en/Error-returns.html is invalid, as that page gives a 404 error.

I'd like to see this bug revived.
[6 Feb 2018 16:13] Asparuh Polyovski
While running TCPDUMP, I get unknown codes: 291, 261, 794

tcpdump -i any -s 65535 -x -n -q -tttt 'port 3306 and tcp[1] & 7 == 2 and tcp[3] & 7 == 2' > tcpdump.out
# captured about 60 seconds while monitored the error log in another session and stopped with <ctrl+c> when the error appeared

The TCPDUMP was related to the generic error we get from MySQL error log:
"[Warning] Aborted connection"

perror 291
Illegal error code: 291

perror 2 91
OS error code   2:  No such file or directory
OS error code  91:  Protocol wrong type for socket

I am not sure if the above separation of error code from 291 -> to 2 91 is correct.