Development notes for the MySQL protocol
The Lindorm Wide Table Engine supports access over the MySQL protocol. You can connect to and use the Lindorm Wide Table Engine with MySQL ecosystem clients. This topic describes the usage notes and related considerations for the MySQL protocol.
Usage notes
The Wide Table Engine supports the MySQL protocol in version 2.6.0 or later. To check or upgrade the current version, see LindormTable release notes and Upgrade the minor engine version of a Lindorm instance.
The SQL syntax supported by the Lindorm Wide Table Engine is not fully compatible with MySQL syntax. For the SQL syntax supported by the Lindorm Wide Table Engine, see SQL reference.
Enablement guide
To enable the MySQL-compatible protocol feature, see Use a MySQL client to connect to and use LindormTable.
Considerations
By default, the Lindorm MySQL protocol disables SSL communication encryption. To use an SSL-encrypted connection, see MySQL Protocol SSL Encryption Guide.
When establishing an SSL connection, some older clients use a lower TLS protocol version (for example, 1.0 or 1.1), which may cause the connection to fail and trigger an exception related to the protocol version. If this occurs, you can resolve it in the following ways:
Establish the connection directly by using plaintext communication.
If the client supports specifying the TLS protocol version (for example, MySQL JDBC 5.1.44 supports specifying the TLS version through the enabledTLSProtocols connection parameter), you can resolve the issue by setting the TLS protocol version to 1.2.
Upgrade the client version. We recommend that you use a client of MySQL 8.0 or later.
Users created under different Wide Table Engine versions can use different protocols. Select the appropriate authentication protocol based on your actual situation:
If the user is created when the Wide Table Engine version is earlier than 2.6.2, only the
caching_sha2_passwordprotocol is supported.If the user is created when the Wide Table Engine is version 2.6.2 or later, both the
caching_sha2_passwordandmysql_native_passwordauthentication protocols are supported. We recommend that you use thecaching_sha2_passwordprotocol first.
For example, if you create a user named user when the Wide Table Engine is version 2.5.4, and then upgrade the Wide Table Engine to version 2.6.2 or later by upgrading the minor version and create a new user named test, the user named user supports only the
caching_sha2_passwordprotocol, while the user named test supports both themysql_native_passwordandcaching_sha2_passwordauthentication protocols.
MySQL protocol compatibility
The MySQL protocol includes multiple sub-protocols. The support status in Lindorm is as follows:
Connection lifecycle | Sub-protocol name | Protocol command | Supported | Feature and description |
Connection Phase | Handshake | Supported | Handshake negotiation before a connection is established. Currently, only the HandshakeV10 protocol is supported. | |
TLS Support | Supported | TLS communication encryption support. Currently, only the TLSv1.2 protocol is supported. Note By default, Lindorm disables SSL encrypted communication. To enable it, see MySQL Protocol SSL Encryption Guide. | ||
Authentication Methods | old_password | Not supported | Legacy password transmission protocol. That is, the user authentication request from older MySQL clients (for example, 4.x or earlier). | |
mysql_clear_password | Supported | Plaintext password transmission protocol. Important It typically needs to be used together with SSL communication encryption. | ||
mysql_native_password | Supported | The default password encryption communication protocol used by MySQL 5.x clients. | ||
caching_sha2_password | Supported | The default password encryption communication protocol used by MySQL 8.x clients. It is more secure and efficient than mysql_native_password. Recommended. | ||
Command Phase | Text Protocol | COM_QUERY | Supported | Sends and executes SQL statements directly. |
Utility Commands | COM_QUIT | Supported | Disconnects from the server. | |
COM_INIT_DB | Supported | Changes the default database of the current connection. | ||
COM_PING | Supported | Checks connectivity between the client and the server. | ||
COM_DEBUG | Not supported | Displays the internal debug information of the server. That is, obtains server-side debug information while executing SQL after connecting to Lindorm. | ||
COM_CHANGE_USER | Not supported | Switches the user of the current connection. | ||
COM_RESET_CONNECTION | Not supported | Resets the session state of the current connection when connecting to Lindorm. | ||
COM_SET_OPTION | Not supported | Sets the connection options of the client. That is, changes the behavior and configuration of the client connection session when connecting to Lindorm. | ||
Prepared Statements | COM_STMT_PREPARE | Supported | Preprocesses a parameterized query. | |
COM_STMT_EXECUTE | Supported | Binds parameters and executes a prepared statement. | ||
COM_STMT_FETCH | Not supported | Uses the FETCH statement in embedded SQL against Lindorm. | ||
COM_STMT_CLOSE | Supported | Closes a prepared statement. | ||
COM_STMT_SEND_LONG_DATA | Not supported | A command used to send large object data. It is executed before COM_STMT_EXECUTE. | ||
Replication Protocol | Not supported | The binary log (binlog) replication protocol of MySQL. | ||