Error Log Error messages can originate on the server side or the client side, and each error message includes an error code, SQLSTATE value, and message string, as described in Section B.1, “Error Message Sources and Elements” . For lists of server-side, client-side, and global (shared between server and clients) errors, see MySQL 8.0 Error Message Reference. For error checking from within programs, use error code numbers or symbols, not error message strings. Message strings do not change often, but it is possible. Also, if the database administrator changes the language setting, that affects the language of message strings; see Section 10.12, “Setting the Error Message Language” . Error information in MySQL is available in the server error log, at the SQL level, from within client programs, and at the command line. On the server side, some messages are intended for the error log. For information about configuring where and how the server writes the log, see Section 5.4.2, “The Error Log” . Other server error messages are intended to be sent to client programs and are available as described in Client Error Message Interface. The range within which a particular error code lies determines whether the server writes an error message to the error log or sends it to clients. For information about these ranges, see Error Code Ranges. At the SQL level, there are several sources of error information in MySQL: Client programs receive errors from two sources: 5284 •Errors that originate on the server side and are sent to the client by the server. These are received within the client library, which makes them available to the host client program. •Errors that originate on the client side from within the MySQL client library. • SHOW ENGINE INNODB STATUS  statement output includes information about the most recent foreign key error if a  CREATE TABLE  statement for an  InnoDB  table fails. • SHOW SLAVE STATUS  statement output includes information about replication errors occurring on replica servers. •The  GET DIAGNOSTICS  statement may be used to inspect the diagnostic information in the diagnostics area. See Section 13.6.7.3, “GET DIAGNOSTICS Statement” . •SQL statement warning and error information is available through the  SHOW WARNINGS  and  SHOW ERRORS  statements. The  warning_count  system variable indicates the number of errors, warnings, and notes (with notes excluded if the  sql_notes  system variable is disabled). The  error_count system variable indicates the number of errors. Its value excludes warnings and notes. •Command-Line Error Message Interface •Client Error Message Interface •SQL Error Message Interface •Error Log Error Log SQL Error Message Interface Client Error Message Interface