Common MYSQL Error – Out of memory
If you issue a query using the mysql client program and receive an error like the following one, it means that mysql does not have enough memory to store the entire query result:
mysql: Out of memory at line 42, ‘malloc.c’
mysql: needed 8136 byte (8k), memory in use: 12481367 bytes (12189k)
ERROR 2008: MySQL client ran out of memory
To remedy the problem, first check whether your query is correct. Is it reasonable that it should return so many rows? If not, correct the query and try again. Otherwise, you can invoke mysql with the –quick option. This causes it to use the mysql_use_result() C API function to retrieve the result set, which places less of a load on the client (but more on the server).
What are MYSQL Errors?
MySQL programs have access to several types of error information when the server returns an error.
The MYSQL message displayed contains three types of information:
A numeric error code. This number is MySQL-specific and is not portable to other database systems.
A five-character SQLSTATE value. The values are specified by ANSI SQL and ODBC and are more standardized. Not all MySQL error numbers are mapped to SQLSTATE error codes.
A message string that provides a textual description of the error.
When an error occurs, you can access the MySQL error code, the SQLSTATE value, and the message string using C API functions:
MySQL error code: Call mysql_errno()
SQLSTATE value: Call mysql_sqlstate()
Error message: Call mysql_error()
Hope this was helpful.
Information about MYSQL Error Codes and Error Messages or Warnings on Windows, Linux Operating Systems.