【Generic Response Packets】->【Status Flags】The status flags are a bit-field:====== =====================flag constant name====== =====================0x0001 SERVER_STATUS_IN_TRANS0x0002SERVER_STATUS_AUTOCOMMIT0x0008_`SERVER_MORE_RESULTS_EXISTS`0x0010SERVER_STATUS_NO_GOOD_INDEX_USED0x0020SERVER_STATUS_NO_INDEX_USED0x0040SERVER_STATUS_CURSOR_EXISTS0x0080SERVER_STATUS_LAST_ROW_SENT0x0100SERVER_STATUS_DB_DROPPED0x0200SERVER_STATUS_NO_BACKSLASH_ESCAPES0x0400SERVER_STATUS_METADATA_CHANGED0x0800SERVER_QUERY_WAS_SLOW0x1000SERVER_PS_OUT_PARAMS===========================The capability flags are used by the client and server to indicate which featuresthey support and want to use.【Auth Challenge Packet】->【Capability flags】====== ======================= ========================flags constant name description====== ======================= ========================0x0001 CLIENT_LONG_PASSWORD new more secure passwords0x0002CLIENT_FOUND_ROWS Found instead of affected rows0x0004CLIENT_LONG_FLAG Get all column flags0x0008CLIENT_CONNECT_WITH_DB One can specify db on connect0x0010CLIENT_NO_SCHEMA Don't allow database.table.column0x0020CLIENT_COMPRESS Can use compression protocol0x0040CLIENT_ODBC Odbc client0x0080_`CLIENT_LOCAL_FILES` Can use LOAD DATA LOCAL0x0100CLIENT_IGNORE_SPACE Ignore spaces before '('0x0200_`CLIENT_PROTOCOL_41` New 4.1 protocol0x0400CLIENT_INTERACTIVE This is an interactive client0x0800CLIENT_SSL Switch to SSL after handshake0x1000CLIENT_IGNORE_SIGPIPE IGNORE sigpipes0x2000CLIENT_TRANSACTIONS Client knows about transactions0x4000CLIENT_RESERVED Old flag for 4.1 protocol0x8000CLIENT_SECURE_CONNECTION New 4.1 authentication====== ======================= ========================【Auth Response Packet】->【Capability flags】`capability flags` are the same as defined in the `Capability flags`_ of the `Auth Challenge Packet`_ plus:====== ======================= ========================flags constant name description====== ======================= ========================0x00010000 _`CLIENT_MULTI_STATEMENTS` Enable/disable multi-stmt support0x00020000 _`CLIENT_MULTI_RESULTS` Enable/disable multi-results0x00040000 _`CLIENT_PS_MULTI_RESULTS` Multi-results in PS-protocol0x40000000 CLIENT_SSL_VERIFY_SERVER_CERT0x80000000 CLIENT_REMEMBER_OPTIONS====== ======================= ========================【command-type】The first byte of the payload describes the command-type like:=== =================== ========================hex constant name description=== =================== ========================00 `COM_SLEEP`_ unhandled01`COM_QUIT`_ tells the server that the client wants to close the connection02 `COM_INIT_DB`_ change the default schema of the connection03 `COM_QUERY`_ tells the server to execute a text-based query04 `COM_FIELD_LIST`_ get the column definition of a tables05 `COM_CREATE_DB`_ create a schema06 `COM_DROP_DB`_ drop a schema07 `COM_REFRESH`_ get a list of active threads08 `COM_SHUTDOWN`_ get a list of active threads09 `COM_STATISTICS`_ get a list of active threads0a `COM_PROCESS_INFO`_ get a list of active threads0b `COM_CONNECT`_ unhandled0c `COM_PROCESS_KILL`_ ask the server to terminate a connection0d `COM_DEBUG`_ dump debug info to stdout0e `COM_PING`_ check if the server is alive0f `COM_TIME`_ unhandled10 `COM_DELAYED_INSERT`_ unhandled11 `COM_CHANGE_USER`_ change the user of the current connection12 COM_BINLOG_DUMP (null)13 `COM_TABLE_DUMP`_ unhandled14 `COM_CONNECT_OUT`_ unhandled15 COM_REGISTER_SLAVE (null)16 `COM_STMT_PREPARE`_ creates a prepared statement from the passed query string.17 `COM_STMT_EXECUTE`_ asks the server to execute a prepared statement as identified by `stmt-id`.18 `COM_STMT_SEND_LONG_DATA`_ sends the data for a column. Repeating to send it, appends the data to the parameter.19 `COM_STMT_CLOSE`_ deallocates a prepared statement.1a `COM_STMT_RESET`_ resets the data of a prepared statement. Useful in together with `COM_STMT_SEND_LONG_DATA`_.1b `COM_SET_OPTION`_ set options for the current connection1c `COM_STMT_FETCH`_ (null)1d `COM_DAEMON`_ unhandled=== =================== ========================Theunhandledcommands belong to* the `Old Commands`_* the `Prepared Statements`_ Commands* the `Stored Procedures`_ Commands* or the Replication Commands
proxy mysql 协议_【原创】MySQL Proxy - 协议(部分摘录)-阿里云开发者社区
最新推荐文章于 2024-04-09 00:05:05 发布