You can find out what the error code means by either examining the documentation for your system or by using the perror utility.
Some examples:
[root@mylinux ~]#perror 147
MySQL error code 147: Lock table is full; Restart program with a larger locktable
[root@mylinux ~]#perror 148
MySQL error code 148: Updates are not allowed under a read only transactions
You can run perror with many arguments:
[root@mylinux ~]#perror 147 148 149
MySQL error code 147: Lock table is full; Restart program with a larger locktable
MySQL error code 148: Updates are not allowed under a read only transactions
MySQL error code 149: Lock deadlock; Retry transaction
The perror utility can be helpful in many cases.
[root@mylinux ~]#perror --help
perror Ver 2.10, for redhat-linux-gnu (i386)
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Print a description for a system error code or an error code from
a MyISAM/ISAM/BDB table handler.
If you want to get the error for a negative error code, you should use
-- before the first error code to tell perror that there was no more options.
Usage: perror [OPTIONS] [ERRORCODE [ERRORCODE...]]
-?, --help Displays this help and exits.
-I, --info Synonym for --help.
-s, --silent Only print the error message.
-v, --verbose Print error code and message (default).
-V, --version Displays version information and exits.
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
verbose TRUE
Some examples:
[root@mylinux ~]#perror 147
MySQL error code 147: Lock table is full; Restart program with a larger locktable
[root@mylinux ~]#perror 148
MySQL error code 148: Updates are not allowed under a read only transactions
You can run perror with many arguments:
[root@mylinux ~]#perror 147 148 149
MySQL error code 147: Lock table is full; Restart program with a larger locktable
MySQL error code 148: Updates are not allowed under a read only transactions
MySQL error code 149: Lock deadlock; Retry transaction
The perror utility can be helpful in many cases.
[root@mylinux ~]#perror --help
perror Ver 2.10, for redhat-linux-gnu (i386)
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Print a description for a system error code or an error code from
a MyISAM/ISAM/BDB table handler.
If you want to get the error for a negative error code, you should use
-- before the first error code to tell perror that there was no more options.
Usage: perror [OPTIONS] [ERRORCODE [ERRORCODE...]]
-?, --help Displays this help and exits.
-I, --info Synonym for --help.
-s, --silent Only print the error message.
-v, --verbose Print error code and message (default).
-V, --version Displays version information and exits.
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
verbose TRUE
01 Feb 2006 08:28:33
Thank you... I've used similer utils for other DBs. Was unaware of the MySQL version.
16 Mar 2006 07:46:32
how to reset Auto increment in mysql Database
thanks.
16 Mar 2006 11:02:16
ALTER TABLE TableName AUTO_INCREMENT=0
27 Apr 2006 06:59:19
How can i print the value of symbolic constant
'CR_SERVER_GONE_ERROR' in a c program if this error
occured. I am able to get the same error in string format, but need to check with the error code which is set for this kind of errors
please help me in find out.
Is there any global variable like 'errno'(in errno.h), which helps me to check the error values
27 Apr 2006 10:04:43
As you are using C, you can call the C API functions:
for prepared statement:
=======================
mysql_stmt_errno() : Returns the error number for the last statement execution.
mysql_stmt_error() : Returns the error message for the last statement execution.
OR:
====
mysql_errno() : Returns the error number for the most recently invoked MySQL function.
mysql_error() : Returns the error message for the most recently invoked MySQL function
For more details about C API functions, look at
the section 'APIs and Libraries' of the MySQL help file
HTH