This document descibes the MySQL network protocol version 10, as of February 2005 (MySQL 4.1.9). It has been produced by reading mysql_com.h, libmysql.c, net.c, sql_parse.cc and sql_show.cc in the MySQL source.
Protocol version 9 was used by MySQL clients and servers before version 3.21. It is unlikely to still be in use, as modern clients cannot connect to version 9 servers. The primary difference between protocol 9 and 10 is in the password algorithm.
Protocol 10 is used by MySQL 3.22 and later. MySQL 4.0 brought in replication, and MySQL 4.1 brought in a new password algorithm, together with a number of protocol extensions, such as multi-statements. It is thus hard for older clients to interoperate properly with a new server, even if the server has been setup with pre-4.1 passwords.
This document describes the 4.1.x protocol only; the previous document can be used to determine the changes for older versions.
The protocol requires first that a client and server negotiate a connection, including agreeing about protocol features and authentication. This is followed by a series of requests from the client and reponses from the server, until either the client issues a QUIT request or the connection is broken.
MySQL uses either a Unix domain socket (usually /tmp/mysql.sock or /var/run/mysqld/mysql.sock), an MS Windows named pipe (usually \\hostname\pipe\mysql), shared memory or a TCP port (usually 3306). It treats all communications methods identically.
Each client message is sent as a single MySQL 'packet'; a server response may consist of many packets. These packets are not related to the underlying network layer packets, and indeed many response packets may be contained in a single IP datagram.
Each packet begins with a 4-byte header. The first three header bytes give the body length as a Little-Endian integer (all MySQL integers are Little-Endian unless described otherwise). The fourth gives a packet number for this transaction, starting from 0, and including both client and server messages. The body of the message then follows.
All example packets are taken from a real system.
Once the transport-level connection is established, the connection negotiation starts with the server identifying itself.
The host sends an initial greeting similar to:
| 37 00 00 00 | Body Length=55, packet=0 |
| 0a | Protocol=10 |
| 34 2e 31 2e 39 2d 6c 6f 67 00 | Version="4.1.9-log" |
| 07 00 00 00 | Thread ID=7 |
| 79 46 2f 57 48 43 57 6a 00 | Salt="yF/WHCWj" |
| 2c a2 | Caps=LONG_FLAG | CONNECT_WITH_DB | COMPRESS | TRANSACTIONS | PROTOCOL_41 | SECURE_CONNECTION |
| 08 | Charset=Latin-1 |
| 02 00 | Status=AUTOCOMMIT |
| 00 00 00 00 00 00 00 00 00 00 00 00 00 | 13 bytes unused |
| 47 5b 72 4e 6c 58 52 72 66 2b 3f 3a 00 | Rest of Salt="G[rNl XRrf+?:" |
The first byte of the message body is the protocol version, currently 10. The protocol version is followed by a version string for the server, null-terminated - the -log suffix means logging is enabled. Following this is a 4-byte integer giving the thread ID of the server thread handling the request. Next come the first 8 bytes of a 'scramble string' salt for encryption, again null-terminated.
This is followed by a 2-byte integer describing the server's capabilities - this server can do LONG_FLAG and CONNECT_WITH_DB, as well as the more recent COMPRESS, TRANSACTIONS and SSL, and, as it's a 4.1.x server, PROTOCOL_41 and SECURE_CONNECTION. There follow 16 bytes of server characteristics: first a single byte giving the server character set and two bytes describing the server status; the rest is currently padded with NUL.
Finally, the remaining 12 bytes of the 'scramble string' are written if long 20-bytes scrambles are being used (as will usually be the case with 4.1.x servers that are not upgrades of previous servers).
The client now sends a request to the server, similar to:
| 3e 00 00 01 | Body Length=62, packet=1 |
| 85 A6 03 00 | Caps=LONG_PASSWORD | LONG_FLAG | TRANSACTIONS | INTERACTIVE | LOCAL_FILES | PROTOCOL_41 | SECURE_CONNECTION | MULTI_STATEMENTS | MULTI_RESULTS |
| 00 00 00 01 | Max packet=224 bytes |
| 08 | Charset = Latin-1 |
| 00 x 23 | For future expansion |
| 72 65 64 66 65 72 6e 69 00 | User = "redferni" |
| 14 ?? x 20 | Password = 20 bytes |
This is the client's turn to send its capabilities in two bytes. These will always include LONG_PASSWORD, LONG_FLAG, TRANSACTIONS, PROTOCOL_41 and SECURE_CONNECTION for 4.1.x clients, and in this case include INTERACTIVE, LOCAL_FILES, MULTI_STATEMENTS and MULTI_RESULTS as well, as this is the standard MySQL command-line client.
This is followed by the maxiumum packet size (usually 16MB) and the client's character set, then 23 bytes of padding.
At this point the client will switch to SSL on the communications channel if it has set the SSL capability bit - which it will not do if the server has not also set that bit.
This is followed by the username, null-terminated, and the scrambled password (the example given here is not a real password) if a password is provided, preceded with a single byte giving its scrambled length (usually 20). If no password is provided, a single NUL is sent and no scramble is added.
If the client is trying to connect to a particular database and the server is capable of CONNECT_WITH_DB, it will add the database name as a null-terminated string (in UTF-8).
The client will now expect the server to send an OK simple response or an error. After an OK response, the flow of client commands can begin; after an error response the client closes the connection.
Under the very special circumstance that the server and client are use 4.1 extensions but the server still has an old password table, it will tell the client to resend the password using the old password protocol 10 algorithm by sending an end of data packet (the single byte 0xfe).
If the client and server are both capable of compression, and the client wants to use it (it usually has to be explicitly enabled), the client will now switch to using it. It follows the standard packet header with a three-byte compressed length. The compression mechanism used is standard zlib.
The client may (if it is the 'commercial', rather than free client) now check the server's licence by issuing a SELECT @@license statement and abort the connection if the server's licence does not match the client's.
When data is sent in tabular form, each field is preceded by its field length, encoded in the following manner:
| Byte | Meaning |
|---|---|
| 0-250 | Same as byte |
| 251 | NULL field |
| 252 | Value in following 2 bytes |
| 253 | Value in following 4 bytes |
| 254 | Value in following 8 bytes |
This mechanism is also used for encoding other integers efficiently.
Fields sent in this manner are marked (FLE).
Most commands produce a simple 'OK' response. This will usually be of the form:
| 07 00 00 01 | Body Length=7, packet=1 |
| 00 | Field count = 0 (FLE) |
| 00 | Affected rows = 0 (FLE) |
| 00 | Insert ID = 0 (FLE) |
| 02 00 | Server status = AUTOCOMMIT |
| 00 00 | Warning count = 0 |
In the case of an OK response to the initial authentication, of course, the packet number will be 2. It is possible that additional information may follow in FLE.
For an error, the response will be more like the following:
| 27 00 00 01 | Body Length=39, packet=1 |
| ff | Error |
| 7a 04 | Error code=NO_SUCH_TABLE (1146) |
| 54 61 62 6c 65 20 27 72 65 64 66 65 72 6e 69 2e 73 61 6d 70 6c 65 27 20 64 6f 65 73 6e 27 74 20 65 78 69 73 74 | Error message="Table 'redferni.sample' doesn't exist" |
The first byte of the error response body is set to 255.
If the body length is at least 4, then the packet contains a 2-byte error code, followed by the error message, of up to 200 characters.
There are 303 error codes, ranging from HASHCHK (1000) to CONFLICTING_DECLARATIONS (1302).
A simple command is sent in the form:
| 0f 00 00 00 | Body Length=15, packet=0 |
| 03 | Command=QUERY |
| 73 68 6f 77 20 64 61 74 61 62 61 73 65 73 | Arg="show databases" |
The first byte is the command code, followed by an optional argument. Any command not explicitly listed, including any SQL command, is sent as QUERY, as in the example.
When the client wishes to disconnect, it sends a QUIT simple
command and closes its end of the connection, as follows
| 01 00 00 00 | Body Length=1, packet=0 |
| 01 | Command=QUIT |
The server will close its end of the connection without further response.
When returning data as a table, as a response to a QUERY, FIELD_LIST or PROCESS_INFO command, MySQL first describes the fields in each row, then sends the rows.
The first packet contains the (non-zero) number of fields, and possibly the number of records.
| 01 00 00 01 | Body Length=1, packet=1 |
| 01 | Number of fields = 1 (FLE) |
This is followed by the field descriptions.
| 1e 00 00 02 | Body Length=20, packet=2 |
| 03 64 65 66 | Catalogue = "def" |
| 00 | DB = "" |
| 00 | Table = "" |
| 00 | Org table = "" |
| 08 44 61 74 61 62 61 73 65 | Name = "Database" |
| 00 | Org name = "" |
| 0c | Fixed length part = 12 (FLE) |
| 08 00 | Char set = Latin-1 |
| 40 00 00 00 | Length = 64 |
| fe | Type = STRING |
| 01 00 | Flags = NOT_NULL |
| 1f | Decimals = 31 |
| 00 00 | Padding |
There is one logical packet per field description. Each field description contains seven or eight parts, each preceded by their length in FLE: the catalogue, database, table, org table, field and org field names, a 12 byte fixed length set of field metadata, and an optional default value.
The metadata gives the field character set, type, flags and number of decimal places.
| 01 00 00 03 | Body Length=1, packet=3 |
| fe | End of field list |
After all the field description packets, a packet with just a single byte of value 254 indicates the start of the rows.
| 09 00 00 04 | Body Length=9, packet=4 |
| 06 41 73 68 6c 65 79 | Row 1 Col 1="Ashley" |
| 01 31 | Row 1 Col 2=1 |
Each row is in a separate packet, with the field values preceded by a field length. All non-binary fields values are sent as text - in particular, all numeric fields appear as ASCII, and timestamps as YYYY-MM-DD HH:MM:SS.µµµµµµ. Trailing spaces are removed from char and varchar fields.
| 05 00 00 06 | Body Length=5, packet=6 |
| fe | End of row list |
| 00 00 | Warning count = 0 |
| 02 00 | Server status = AUTOCOMMIT |
After the last row, another packet holding the byte 254, but with length less than 8 indicates the end of the data. It is followed by two fields for warning count and server status - for some reason, these are the opposite way round to a simple response.
If a file is to be sent to the server, the following response is generated:
| 01 00 00 01 | Body Length=1, packet=1 |
| fb | 251 = Upload file |
The file is sent by the client as a series of ordinary packets, with the final packet empty.
The server will respond, usually with a simple response.
There are four commands that can return complex responses.
The STATISTICS command response is simply a string describing the current server statistics.
The FIELD_LIST command response is the same as the first part of a tabular response (the field descriptions) - with the exception that a default value may be attached to each field description.
The PROCESS_INFO command response is first a packet containing a field count, in FLE, followed by a tabular response.
The QUERY command handles all SQL commands, as well as almost all client commands.
The first part of any response is a number of fields in FLE. A zero value indicates a simple response; a NULL value indicates a file upload and any other value indicates a tabular response.
Many MySQL clients and drivers expect certain behaviour from the server, and perform queries behind the scenes. The important responses are shown below.
The mysql command-line client issues the request
select DATABASE(),USER()
when the user asks for the current status. It will expect the
following response:
| DATABASE() | USER() |
| VARCHAR(34) NOT NULL | VARCHAR(77) NOT NULL |
The DATABASE() field may be empty. The USER() field is of the form user@host.
The current status response is similar to:
Uptime: 129 Threads: 1 Questions: 6 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 0 Queries per second avg: 0.047
The mysql client assumes the number following the first space is a time and formats it appropriately.
| Variable_name | Value |
| CHAR(30) NOT NULL | CHAR(256) NOT NULL |
| Database |
| CHAR(64) NOT NULL |
| Tables_in_db |
| CHAR(64) NOT NULL |
| Field | Type | Null | Key | Default | Extra |
| CHAR(64) NOT NULL | CHAR(40) NOT NULL | CHAR(1) NOT NULL | CHAR(3) NOT NULL | CHAR(64) | CHAR(20) NOT NULL |
The Null field takes values '' or 'YES' - this is presumably a bug. The Key field is 'PRI', 'UNI', 'MUL'or ''.
The same output is produced by show columns, desc or describe.
| Id | User | Host | db | Command | Time | State | Info |
| Int | CHAR(16) NOT NULL | CHAR(64) NOT NULL | CHAR(64) | CHAR(16) NOT NULL | CHAR(7) NOT NULL | CHAR(30) | CHAR(100) |
Show processlist full removes the size limit on the Info column.
The new MySQL 4.1.x password algorithm is more complex and probably more secure than the older algorithms.
The client uses the salt sent by the server and its own knowledge of the password to produce a scrambled password that it sends to the server. The server does a similar calculation.
The hashing algorithm used is SHA1 - see RFC 2289, 3174
The client first calculates hash1 = SHA1(password), then hash2 = SHA1(hash1). The server already knows this, as that is what is held in its password table (preceded with a *).
It then appends hash2 to the salt sent by the server and hashes that, and finally exclusive ors the result with hash1.
So it sends to the server SHA1(password) XOR SHA1(salt.SHA1(SHA1(password)).
The server does effectively the same calculation and checks the result (though for some reason it prefers to undo the Exclusive-OR and compare with hash1).
MySQL uses the following codes:
| Capability name | Value | Meaning |
|---|---|---|
| LONG_PASSWORD | 1 | New more secure passwords |
| FOUND_ROWS | 2 | Found instead of affected rows |
| LONG_FLAG | 4 | Get all column flags |
| CONNECT_WITH_DB | 8 | One can specify db on connect |
| NO_SCHEMA | 16 | Don't allow database.table.column |
| COMPRESS | 32 | Can use compression protocol |
| ODBC | 64 | ODBC client |
| LOCAL_FILES | 128 | Can use LOAD DATA LOCAL |
| IGNORE_SPACE | 256 | Ignore spaces before '(' |
| PROTOCOL_41 | 512 | Support the 4.1 protocol |
| INTERACTIVE | 1024 | This is an interactive client |
| SSL | 2048 | Switch to SSL after handshake |
| IGNORE_SIGPIPE | 4096 | IGNORE sigpipes |
| TRANSACTIONS | 8192 | Client knows about transactions |
| SECURE_CONNECTION | 32768 | New 4.1 authentication |
| MULTI_STATEMENTS | 65536 | Multi-statement support |
| MULTI_RESULTS | 131072 | Multi-results |
| Command | Code | Arguments | Allowed from client |
|---|---|---|---|
| SLEEP | 0 | No | |
| QUIT | 1 | "" | |
| INIT_DB | 2 | db | |
| QUERY | 3 | query | |
| FIELD_LIST | 4 | table | |
| CREATE_DB | 5 | db | |
| DROP_DB | 6 | db | |
| REFRESH | 7 | option bits | |
| SHUTDOWN | 8 | level (optional) | |
| STATISTICS | 9 | ||
| PROCESS_INFO | 10 | ||
| CONNECT | 11 | No | |
| PROCESS_KILL | 12 | 4-byte pid | |
| DEBUG | 13 | ||
| PING | 14 | ||
| TIME | 15 | No | |
| DELAYED_INSERT | 16 | No | |
| CHANGE_USER | 17 | user | |
| BINLOG_DUMP | 18 | ||
| TABLE_DUMP | 19 | ||
| CONNECT_OUT | 20 | No | |
| REGISTER_SLAVE | 21 | No | |
| PREPARE | 22 | query | |
| EXECUTE | 23 | statement; params | |
| LONG_DATA | 24 | statement; parameter; data | |
| CLOSE_STMT | 25 | statement | |
| RESET_STMT | 26 | statement | |
| SET_OPTION | 27 | 2 byte flags |
| Type | Code | Type | Code |
|---|---|---|---|
| DECIMAL | 0 | ENUM | 247 |
| TINY | 1 | SET | 248 |
| SHORT | 2 | TINY_BLOB | 249 |
| LONG | 3 | MEDIUM_BLOB | 250 |
| FLOAT | 4 | LONG_BLOB | 251 |
| DOUBLE | 5 | BLOB | 252 |
| NULL | 6 | VAR_STRING | 253 |
| TIMESTAMP | 7 | STRING | 254 |
| LONGLONG | 8 | GEOMETRY | 255 |
| INT24 | 9 | ||
| DATE | 10 | ||
| TIME | 11 | ||
| DATETIME | 12 | ||
| YEAR | 13 | ||
| NEWDATE | 14 |
| Status | Code |
|---|---|
| IN_TRANS | 1 |
| AUTOCOMMIT | 2 |
| MORE_RESULTS | 4 |
| MORE_RESULTS_EXISTS | 8 |
| QUERY_NO_GOOD_INDEX_USED | 16 |
| QUERY_NO_INDEX_USED | 32 |
| Charset | Code | Charset | Code |
|---|---|---|---|
| big5_chinese_ci | 1 | latin1_general_cs | 49 |
| latin2_czech_cs | 2 | cp1251_bin | 50 |
| dec8_swedish_ci | 3 | cp1251_general_ci | 51 |
| cp850_general_ci | 4 | cp1251_general_cs | 52 |
| latin1_german1_ci | 5 | macroman_bin | 53 |
| hp8_english_ci | 6 | macroman_ci | 54 |
| koi8r_general_ci | 7 | macroman_ci_ai | 55 |
| latin1_swedish_ci | 8 | macroman_cs | 56 |
| latin2_general_ci | 9 | cp1256_general_ci | 57 |
| swe7_swedish_ci | 10 | cp1257_bin | 58 |
| ascii_general_ci | 11 | cp1257_general_ci | 59 |
| ujis_japanese_ci | 12 | cp1257_ci | 60 |
| sjis_japanese_ci | 13 | cp1257_cs | 61 |
| cp1251_bulgarian_ci | 14 | binary | 63 |
| latin1_danish_ci | 15 | armscii8_bin | 64 |
| hebrew_general_ci | 16 | ascii_bin | 65 |
| tis620_thai_ci | 18 | cp1250_bin | 66 |
| euckr_korean_ci | 19 | cp1256_bin | 67 |
| latin7_estonian_cs | 20 | cp866_bin | 68 |
| latin2_hungarian_ci | 21 | dec8_bin | 69 |
| koi8u_general_ci | 22 | greek_bin | 70 |
| cp1251_ukrainian_ci | 23 | hebrew_bin | 71 |
| gb2312_chinese_ci | 24 | hp8_bin | 72 |
| greek_general_ci | 25 | keybcs2_bin | 73 |
| cp1250_general_ci | 26 | koi8r_bin | 74 |
| latin2_croatian_ci | 27 | koi8u_bin | 75 |
| gbk_chinese_ci | 28 | latin2_bin | 77 |
| cp1257_lithuanian_ci | 29 | latin5_bin | 78 |
| latin5_turkish_ci | 30 | latin7_bin | 79 |
| latin1_german2_ci | 31 | cp850_bin | 80 |
| armscii8_general_ci | 32 | cp852_bin | 81 |
| utf8_general_ci | 33 | swe7_bin | 82 |
| cp1250_czech_cs | 34 | utf8_bin | 83 |
| ucs2_general_ci | 35 | big5_bin | 84 |
| cp866_general_ci | 36 | euckr_bin | 85 |
| keybcs2_general_ci | 37 | gb2312 | 86 |
| macce_general_ci | 38 | gbk_bin | 87 |
| macroman_general_ci | 39 | sjis_bin | 88 |
| cp852_general_ci | 40 | tis620_bin | 89 |
| latin7_general_ci | 41 | ucs2_bin | 90 |
| latin7_general_cs | 42 | ujis_bin | 91 |
| macce_bin | 43 | geostd8_general_ci | 92 |
| latin1_bin | 47 | geostd8_bin | 93 |
| latin1_general_ci | 48 | latin1_spanish_ci | 94 |
| Field Flag | Value | Meaning |
|---|---|---|
| NOT_NULL | 1 | Field can't be NULL |
| PRI_KEY | 2 | Field is part of a primary key |
| UNIQUE_KEY | 4 | Field is part of a unique key |
| MULTIPLE_KEY | 8 | Field is part of a key |
| BLOB | 16 | Field is a blob |
| UNSIGNED | 32 | Field is unsigned |
| ZEROFILL | 64 | Field is zerofill |
| BINARY | 128 | Field is binary |
| ENUM | 256 | Field is an enum |
| AUTO_INCREMENT | 512 | Field is an autoincrement field |
| TIMESTAMP | 1024 | Field is a timestamp |
| SET | 2048 | Field is a set |
| NUM | 32768 | Field is num (for clients) |
| Error | Value | Error | Value |
|---|---|---|---|
| HASHCHK | 1000 | ABORTING_CONNECTION | 1152 |
| NISAMCHK | 1001 | NET_PACKET_TOO_LARGE | 1153 |
| NO | 1002 | NET_READ_ERROR_FROM_PIPE | 1154 |
| YES | 1003 | NET_FCNTL_ERROR | 1155 |
| CANT_CREATE_FILE | 1004 | NET_PACKETS_OUT_OF_ORDER | 1156 |
| CANT_CREATE_TABLE | 1005 | NET_UNCOMPRESS_ERROR | 1157 |
| CANT_CREATE_DB | 1006 | NET_READ_ERROR | 1158 |
| DB_CREATE_EXISTS | 1007 | NET_READ_INTERRUPTED | 1159 |
| DB_DROP_EXISTS | 1008 | NET_ERROR_ON_WRITE | 1160 |
| DB_DROP_DELETE | 1009 | NET_WRITE_INTERRUPTED | 1161 |
| DB_DROP_RMDIR | 1010 | TOO_LONG_STRING | 1162 |
| CANT_DELETE_FILE | 1011 | TABLE_CANT_HANDLE_BLOB | 1163 |
| CANT_FIND_SYSTEM_REC | 1012 | TABLE_CANT_HANDLE_AUTO_INCREMENT | 1164 |
| CANT_GET_STAT | 1013 | DELAYED_INSERT_TABLE_LOCKED | 1165 |
| CANT_GET_WD | 1014 | WRONG_COLUMN_NAME | 1166 |
| CANT_LOCK | 1015 | WRONG_KEY_COLUMN | 1167 |
| CANT_OPEN_FILE | 1016 | WRONG_MRG_TABLE | 1168 |
| FILE_NOT_FOUND | 1017 | DUP_UNIQUE | 1169 |
| CANT_READ_DIR | 1018 | BLOB_KEY_WITHOUT_LENGTH | 1170 |
| CANT_SET_WD | 1019 | PRIMARY_CANT_HAVE_NULL | 1171 |
| CHECKREAD | 1020 | TOO_MANY_ROWS | 1172 |
| DISK_FULL | 1021 | REQUIRES_PRIMARY_KEY | 1173 |
| DUP_KEY | 1022 | NO_RAID_COMPILED | 1174 |
| ERROR_ON_CLOSE | 1023 | UPDATE_WITHOUT_KEY_IN_SAFE_MODE | 1175 |
| ERROR_ON_READ | 1024 | KEY_DOES_NOT_EXITS | 1176 |
| ERROR_ON_RENAME | 1025 | CHECK_NO_SUCH_TABLE | 1177 |
| ERROR_ON_WRITE | 1026 | CHECK_NOT_IMPLEMENTED | 1178 |
| FILE_USED | 1027 | CANT_DO_THIS_DURING_AN_TRANSACTION | 1179 |
| FILSORT_ABORT | 1028 | ERROR_DURING_COMMIT | 1180 |
| FORM_NOT_FOUND | 1029 | ERROR_DURING_ROLLBACK | 1181 |
| GET_ERRNO | 1030 | ERROR_DURING_FLUSH_LOGS | 1182 |
| ILLEGAL_HA | 1031 | ERROR_DURING_CHECKPOINT | 1183 |
| KEY_NOT_FOUND | 1032 | NEW_ABORTING_CONNECTION | 1184 |
| NOT_FORM_FILE | 1033 | DUMP_NOT_IMPLEMENTED | 1185 |
| NOT_KEYFILE | 1034 | FLUSH_MASTER_BINLOG_CLOSED | 1186 |
| OLD_KEYFILE | 1035 | INDEX_REBUILD | 1187 |
| OPEN_AS_READONLY | 1036 | MASTER | 1188 |
| OUTOFMEMORY | 1037 | MASTER_NET_READ | 1189 |
| OUT_OF_SORTMEMORY | 1038 | MASTER_NET_WRITE | 1190 |
| UNEXPECTED_EOF | 1039 | FT_MATCHING_KEY_NOT_FOUND | 1191 |
| CON_COUNT_ERROR | 1040 | LOCK_OR_ACTIVE_TRANSACTION | 1192 |
| OUT_OF_RESOURCES | 1041 | UNKNOWN_SYSTEM_VARIABLE | 1193 |
| BAD_HOST_ERROR | 1042 | CRASHED_ON_USAGE | 1194 |
| HANDSHAKE_ERROR | 1043 | CRASHED_ON_REPAIR | 1195 |
| DBACCESS_DENIED_ERROR | 1044 | WARNING_NOT_COMPLETE_ROLLBACK | 1196 |
| ACCESS_DENIED_ERROR | 1045 | TRANS_CACHE_FULL | 1197 |
| NO_DB_ERROR | 1046 | SLAVE_MUST_STOP | 1198 |
| UNKNOWN_COM_ERROR | 1047 | SLAVE_NOT_RUNNING | 1199 |
| BAD_NULL_ERROR | 1048 | BAD_SLAVE | 1200 |
| BAD_DB_ERROR | 1049 | MASTER_INFO | 1201 |
| TABLE_EXISTS_ERROR | 1050 | SLAVE_THREAD | 1202 |
| BAD_TABLE_ERROR | 1051 | TOO_MANY_USER_CONNECTIONS | 1203 |
| NON_UNIQ_ERROR | 1052 | SET_CONSTANTS_ONLY | 1204 |
| SERVER_SHUTDOWN | 1053 | LOCK_WAIT_TIMEOUT | 1205 |
| BAD_FIELD_ERROR | 1054 | LOCK_TABLE_FULL | 1206 |
| WRONG_FIELD_WITH_GROUP | 1055 | READ_ONLY_TRANSACTION | 1207 |
| WRONG_GROUP_FIELD | 1056 | DROP_DB_WITH_READ_LOCK | 1208 |
| WRONG_SUM_SELECT | 1057 | CREATE_DB_WITH_READ_LOCK | 1209 |
| WRONG_VALUE_COUNT | 1058 | WRONG_ARGUMENTS | 1210 |
| TOO_LONG_IDENT | 1059 | NO_PERMISSION_TO_CREATE_USER | 1211 |
| DUP_FIELDNAME | 1060 | UNION_TABLES_IN_DIFFERENT_DIR | 1212 |
| DUP_KEYNAME | 1061 | LOCK_DEADLOCK | 1213 |
| DUP_ENTRY | 1062 | TABLE_CANT_HANDLE_FT | 1214 |
| WRONG_FIELD_SPEC | 1063 | CANNOT_ADD_FOREIGN | 1215 |
| PARSE_ERROR | 1064 | NO_REFERENCED_ROW | 1216 |
| EMPTY_QUERY | 1065 | ROW_IS_REFERENCED | 1217 |
| NONUNIQ_TABLE | 1066 | CONNECT_TO_MASTER | 1218 |
| INVALID_DEFAULT | 1067 | QUERY_ON_MASTER | 1219 |
| MULTIPLE_PRI_KEY | 1068 | ERROR_WHEN_EXECUTING_COMMAND | 1220 |
| TOO_MANY_KEYS | 1069 | WRONG_USAGE | 1221 |
| TOO_MANY_KEY_PARTS | 1070 | WRONG_NUMBER_OF_COLUMNS_IN_SELECT | 1222 |
| TOO_LONG_KEY | 1071 | CANT_UPDATE_WITH_READLOCK | 1223 |
| KEY_COLUMN_DOES_NOT_EXITS | 1072 | MIXING_NOT_ALLOWED | 1224 |
| BLOB_USED_AS_KEY | 1073 | DUP_ARGUMENT | 1225 |
| TOO_BIG_FIELDLENGTH | 1074 | USER_LIMIT_REACHED | 1226 |
| WRONG_AUTO_KEY | 1075 | SPECIFIC_ACCESS_DENIED_ERROR | 1227 |
| READY | 1076 | LOCAL_VARIABLE | 1228 |
| NORMAL_SHUTDOWN | 1077 | GLOBAL_VARIABLE | 1229 |
| GOT_SIGNAL | 1078 | NO_DEFAULT | 1230 |
| SHUTDOWN_COMPLETE | 1079 | WRONG_VALUE_FOR_VAR | 1231 |
| FORCING_CLOSE | 1080 | WRONG_TYPE_FOR_VAR | 1232 |
| IPSOCK_ERROR | 1081 | VAR_CANT_BE_READ | 1233 |
| NO_SUCH_INDEX | 1082 | CANT_USE_OPTION_HERE | 1234 |
| WRONG_FIELD_TERMINATORS | 1083 | NOT_SUPPORTED_YET | 1235 |
| BLOBS_AND_NO_TERMINATED | 1084 | MASTER_FATAL_ERROR_READING_BINLOG | 1236 |
| TEXTFILE_NOT_READABLE | 1085 | SLAVE_IGNORED_TABLE | 1237 |
| FILE_EXISTS_ERROR | 1086 | INCORRECT_GLOBAL_LOCAL_VAR | 1238 |
| LOAD_INFO | 1087 | WRONG_FK_DEF | 1239 |
| ALTER_INFO | 1088 | KEY_REF_DO_NOT_MATCH_TABLE_REF | 1240 |
| WRONG_SUB_KEY | 1089 | OPERAND_COLUMNS | 1241 |
| CANT_REMOVE_ALL_FIELDS | 1090 | SUBQUERY_NO_1_ROW | 1242 |
| CANT_DROP_FIELD_OR_KEY | 1091 | UNKNOWN_STMT_HANDLER | 1243 |
| INSERT_INFO | 1092 | CORRUPT_HELP_DB | 1244 |
| UPDATE_TABLE_USED | 1093 | CYCLIC_REFERENCE | 1245 |
| NO_SUCH_THREAD | 1094 | AUTO_CONVERT | 1246 |
| KILL_DENIED_ERROR | 1095 | ILLEGAL_REFERENCE | 1247 |
| NO_TABLES_USED | 1096 | DERIVED_MUST_HAVE_ALIAS | 1248 |
| TOO_BIG_SET | 1097 | SELECT_REDUCED | 1249 |
| NO_UNIQUE_LOGFILE | 1098 | TABLENAME_NOT_ALLOWED_HERE | 1250 |
| TABLE_NOT_LOCKED_FOR_WRITE | 1099 | NOT_SUPPORTED_AUTH_MODE | 1251 |
| TABLE_NOT_LOCKED | 1100 | SPATIAL_CANT_HAVE_NULL | 1252 |
| BLOB_CANT_HAVE_DEFAULT | 1101 | COLLATION_CHARSET_MISMATCH | 1253 |
| WRONG_DB_NAME | 1102 | SLAVE_WAS_RUNNING | 1254 |
| WRONG_TABLE_NAME | 1103 | SLAVE_WAS_NOT_RUNNING | 1255 |
| TOO_BIG_SELECT | 1104 | TOO_BIG_FOR_UNCOMPRESS | 1256 |
| UNKNOWN_ERROR | 1105 | ZLIB_Z_MEM_ERROR | 1257 |
| UNKNOWN_PROCEDURE | 1106 | ZLIB_Z_BUF_ERROR | 1258 |
| WRONG_PARAMCOUNT_TO_PROCEDURE | 1107 | ZLIB_Z_DATA_ERROR | 1259 |
| WRONG_PARAMETERS_TO_PROCEDURE | 1108 | CUT_VALUE_GROUP_CONCAT | 1260 |
| UNKNOWN_TABLE | 1109 | WARN_TOO_FEW_RECORDS | 1261 |
| FIELD_SPECIFIED_TWICE | 1110 | WARN_TOO_MANY_RECORDS | 1262 |
| INVALID_GROUP_FUNC_USE | 1111 | WARN_NULL_TO_NOTNULL | 1263 |
| UNSUPPORTED_EXTENSION | 1112 | WARN_DATA_OUT_OF_RANGE | 1264 |
| TABLE_MUST_HAVE_COLUMNS | 1113 | WARN_DATA_TRUNCATED | 1265 |
| RECORD_FILE_FULL | 1114 | WARN_USING_OTHER_HANDLER | 1266 |
| UNKNOWN_CHARACTER_SET | 1115 | CANT_AGGREGATE_2COLLATIONS | 1267 |
| TOO_MANY_TABLES | 1116 | DROP_USER | 1268 |
| TOO_MANY_FIELDS | 1117 | REVOKE_GRANTS | 1269 |
| TOO_BIG_ROWSIZE | 1118 | CANT_AGGREGATE_3COLLATIONS | 1270 |
| STACK_OVERRUN | 1119 | CANT_AGGREGATE_NCOLLATIONS | 1271 |
| WRONG_OUTER_JOIN | 1120 | VARIABLE_IS_NOT_STRUCT | 1272 |
| NULL_COLUMN_IN_INDEX | 1121 | UNKNOWN_COLLATION | 1273 |
| CANT_FIND_UDF | 1122 | SLAVE_IGNORED_SSL_PARAMS | 1274 |
| CANT_INITIALIZE_UDF | 1123 | SERVER_IS_IN_SECURE_AUTH_MODE | 1275 |
| UDF_NO_PATHS | 1124 | WARN_FIELD_RESOLVED | 1276 |
| UDF_EXISTS | 1125 | BAD_SLAVE_UNTIL_COND | 1277 |
| CANT_OPEN_LIBRARY | 1126 | MISSING_SKIP_SLAVE | 1278 |
| CANT_FIND_DL_ENTRY | 1127 | UNTIL_COND_IGNORED | 1279 |
| FUNCTION_NOT_DEFINED | 1128 | WRONG_NAME_FOR_INDEX | 1280 |
| HOST_IS_BLOCKED | 1129 | WRONG_NAME_FOR_CATALOG | 1281 |
| HOST_NOT_PRIVILEGED | 1130 | WARN_QC_RESIZE | 1282 |
| PASSWORD_ANONYMOUS_USER | 1131 | BAD_FT_COLUMN | 1283 |
| PASSWORD_NOT_ALLOWED | 1132 | UNKNOWN_KEY_CACHE | 1284 |
| PASSWORD_NO_MATCH | 1133 | WARN_HOSTNAME_WONT_WORK | 1285 |
| UPDATE_INFO | 1134 | UNKNOWN_STORAGE_ENGINE | 1286 |
| CANT_CREATE_THREAD | 1135 | WARN_DEPRECATED_SYNTAX | 1287 |
| WRONG_VALUE_COUNT_ON_ROW | 1136 | NON_UPDATABLE_TABLE | 1288 |
| CANT_REOPEN_TABLE | 1137 | FEATURE_DISABLED | 1289 |
| INVALID_USE_OF_NULL | 1138 | OPTION_PREVENTS_STATEMENT | 1290 |
| REGEXP_ERROR | 1139 | DUPLICATED_VALUE_IN_TYPE | 1291 |
| MIX_OF_GROUP_FUNC_AND_FIELDS | 1140 | TRUNCATED_WRONG_VALUE | 1292 |
| NONEXISTING_GRANT | 1141 | TOO_MUCH_AUTO_TIMESTAMP_COLS | 1293 |
| TABLEACCESS_DENIED_ERROR | 1142 | INVALID_ON_UPDATE | 1294 |
| COLUMNACCESS_DENIED_ERROR | 1143 | UNSUPPORTED_PS | 1295 |
| ILLEGAL_GRANT_FOR_TABLE | 1144 | GET_ERRMSG | 1296 |
| GRANT_WRONG_HOST_OR_USER | 1145 | GET_TEMPORARY_ERRMSG | 1297 |
| NO_SUCH_TABLE | 1146 | UNKNOWN_TIME_ZONE | 1298 |
| NONEXISTING_TABLE_GRANT | 1147 | WARN_INVALID_TIMESTAMP | 1299 |
| NOT_ALLOWED_COMMAND | 1148 | INVALID_CHARACTER_STRING | 1300 |
| SYNTAX_ERROR | 1149 | WARN_ALLOWED_PACKET_OVERFLOWED | 1301 |
| DELAYED_CANT_CHANGE_LOCK | 1150 | CONFLICTING_DECLARATIONS | 1302 |
| TOO_MANY_DELAYED_THREADS | 1151 |
This document is in the public domain, and you may do anything with it you wish. The author takes no responsibility for the accuracy of its contents. Some of the terms in this document are trademarks of MySQL AB and other companies. No trade secrets or other privileged information has been used in its compilation, and the author has no relationship with MySQL.