MySQL 9.7 Error Reference  /  Server Error Message Reference

Chapter 2 Server Error Message Reference

The MySQL server writes some error messages to its error log, and sends others to client programs.

Example server-side error messages written to the error log:

2018-10-28T13:01:32.735983Z 0 [Note] [MY-010303] [Server] Skipping
generation of SSL certificates as options related to SSL are specified.

2018-10-02T03:20:39.410387Z 768 [ERROR] [MY-010045] [Server] Event Scheduler:
[evtuser@localhost][myschema.e_daily] Unknown database 'mydb'

Example server-side error message sent to client programs, as displayed by the mysql client:

mysql> SELECT * FROM no_such_table;
ERROR 1146 (42S02): Table 'test.no_such_table' doesn't exist

Each server error message includes an error code, SQLSTATE value, and message string, as described in Error Message Sources and Elements. These elements are available as described in Error Information Interfaces.

In addition to the errors in the following list, the server can also produce error messages that have error codes in the range from 1 to 999. See Chapter 4, Global Error Message Reference

  • Error number: 1002; Symbol: ER_NO; SQLSTATE: HY000

    Message: NO

    Used in the construction of other messages.

  • Error number: 1003; Symbol: ER_YES; SQLSTATE: HY000

    Message: YES

    Used in the construction of other messages.

    Extended EXPLAIN format generates Note messages. ER_YES is used in the Code column for these messages in subsequent SHOW WARNINGS output.

  • Error number: 1004; Symbol: ER_CANT_CREATE_FILE; SQLSTATE: HY000

    Message: Can't create file '%s' (errno: %d - %s)

    Occurs for failure to create or copy a file needed for some operation.

    Possible causes: Permissions problem for source file; destination file already exists but is not writeable.

  • Error number: 1005; Symbol: ER_CANT_CREATE_TABLE; SQLSTATE: HY000

    Message: Can't create table '%s' (errno: %d - %s)

    InnoDB reports this error when a table cannot be created. If the error message refers to error 150, table creation failed because a foreign key constraint was not correctly formed. If the error message refers to error −1, table creation probably failed because the table includes a column name that matched the name of an internal InnoDB table.

  • Error number: 1006; Symbol: ER_CANT_CREATE_DB; SQLSTATE: HY000

    Message: Can't create database '%s' (errno: %d - %s)

  • Error number: 1007; Symbol: ER_DB_CREATE_EXISTS; SQLSTATE: HY000

    Message: Can't create database '%s'; database exists

    An attempt to create a database failed because the database already exists.

    Drop the database first if you really want to replace an existing database, or add an IF NOT EXISTS clause to the CREATE DATABASE statement if to retain an existing database without having the statement produce an error.

  • Error number: 1008; Symbol: ER_DB_DROP_EXISTS; SQLSTATE: HY000

    Message: Can't drop database '%s'; database doesn't exist

  • Error number: 1010; Symbol: ER_DB_DROP_RMDIR; SQLSTATE: HY000

    Message: Error dropping database (can't rmdir '%s', errno: %d - %s)

  • Error number: 1012; Symbol: ER_CANT_FIND_SYSTEM_REC; SQLSTATE: HY000

    Message: Can't read record in system table

    Returned by InnoDB for attempts to access InnoDB INFORMATION_SCHEMA tables when InnoDB is unavailable.

  • Error number: 1013; Symbol: ER_CANT_GET_STAT; SQLSTATE: HY000

    Message: Can't get status of '%s' (errno: %d - %s)

  • Error number: 1015; Symbol: ER_CANT_LOCK; SQLSTATE: HY000

    Message: Can't lock file (errno: %d - %s)

  • Error number: 1016; Symbol: ER_CANT_OPEN_FILE; SQLSTATE: HY000

    Message: Can't open file: '%s' (errno: %d - %s)

    InnoDB reports this error when the table from the InnoDB data files cannot be found.

  • Error number: 1017; Symbol: ER_FILE_NOT_FOUND; SQLSTATE: HY000

    Message: Can't find file: '%s' (errno: %d - %s)

  • Error number: 1018; Symbol: ER_CANT_READ_DIR; SQLSTATE: HY000

    Message: Can't read dir of '%s' (errno: %d - %s)

  • Error number: 1020; Symbol: ER_CHECKREAD; SQLSTATE: HY000

    Message: Record has changed since last read in table '%s'

  • Error number: 1022; Symbol: