LindormTable allows access over the MySQL protocol. You can use a MySQL-based client to connect to and use LindormTable. This topic describes how to use MySQL to develop applications and related usage notes.
Usage notes
LindormTable 2.6.0 and later versions support MySQL. For more information about how to view or upgrade the version of LindormTable, see Release notes of LindormTable and Upgrade the minor engine version of a Lindorm instance.
The SQL syntax supported by LindormTable is not fully compatible with the MySQL syntax. For more information about the SQL syntax supported by LindormTable, see Lindorm SQL syntax.
Enable the MySQL compatibility feature
For more information about how to enable the MySQL compatibility feature, see Use a MySQL client to connect to and use LindormTable.
Precautions
By default, SSL encryption is enabled for data transmission for security when you use MySQL to connect to LindormTable. If your application and Lindorm instance are deployed in the same VPC, you can enable plaintext communication on the MySQL client for better performance. For example, if you use MySQL JDBC V8.x to connect to LindormTable, you can specify
sslMode=disabled
in the connection URL to enable plaintext communication.Some earlier versions of MySQL clients use an earlier version of the TLS protocol (such as V1.0 or V1.1). In this case, the connection may fail and cause exceptions that are specific to the protocol version. In this case, you can use one of the following methods to handle the issues:
Establish a connection in which data is transmitted by using plaintext.
If you can configure the TLS version for your client, set the TLS version to 1.2. For example, if you use MySQL JDBC V5.1.44, you can configure the enabledTLSProtocols parameter to specify the TLS version.
Upgrade your client. We recommend that you use clients that support MySQL 8.0 or later versions.
The authentication protocols that can be used by a user during connection vary with the LindormTable version of the instance when the user is created. Select the authentication protocol based on your requirements.
If the LindormTable version is earlier than 2.6.2 when the user is created, only the
caching_sha2_password
protocol can be used by the user for authentication.If the LindormTable version is 2.6.2 or later when the user is created, the
caching_sha2_password
andmysql_native_password
protocols can be used by the user for authentication. We recommend that you use thecaching_sha2_password
protocol.
For example, you create a user named user for an Lindorm instance in which the LindormTable version is 2.5.4, and then create a user named test after you update the LindormTable version to 2.6.2, the user named user supports only the
caching_sha2_password
protocol and the user named test supports themysql_native_password
andcaching_sha2_password
protocols.
Compatibility with MySQL protocols
The MySQL protocol includes multiple sub-protocols. The following table describes the compatibility of Lindorm with these sub-protocols.
Phase | Sub-protocol | Protocol command | Supported by Lindorm | Description |
Connection Phase | Handshake | Yes | The handshake protocol used before a connection is established. Only HandshakeV10 is supported. | |
TLS Support | Yes | The TLS protocol used for communication encryption. Only TLS 1.2 is supported. Note By default, the SSL protocol is used for encrypt transmitted data when you connect to Lindorm. | ||
Authentication Methods | old_password | No | The earlier version of protocol used to transmit passwords. This protocol is used by MySQL clients of earlier versions (4.x or earlier) to transmit user authentication requests. | |
mysql_clear_password | Yes | The protocol used to transmit plaintext passwords. Important This protocol is generally used together with SSL. | ||
mysql_native_password | Yes | The default protocol used by MySQL clients of the 5.x version to transmit passwords. | ||
caching_sha2_password | Yes | The default protocol used by MySQL clients of the 8.x version to transmit passwords. This protocol is enhanced in security and efficiency compared with mysql_native_password. We recommend that you use this protocol. | ||
Command Phase | Text Protocol | COM_QUERY | Yes | The command used to send and execute SQL statements. |
Utility Commands | COM_QUIT | Yes | The command used to disconnect from LindormTable. | |
COM_INIT_DB | Yes | The command used to modify the default database that is to be connected. | ||
COM_PING | Yes | The command used to check the connectivity between the client and server. | ||
COM_DEBUG | No | The command used to display the debugging information about SQL statements at the server side when the statements are executed. | ||
COM_CHANGE_USER | No | The command used to switch the user of the current connection. | ||
COM_RESET_CONNECTION | No | The command used to reset the session status of the current connection when you connect to Lindorm. | ||
COM_SET_OPTION | No | The command used to configure connection options to specify the behaviors and settings of the client when you connect to Lindorm. | ||
Prepared Statements | COM_STMT_PREPARE | Yes | The command used to preprocess query statements in which parameters are configured. | |
COM_STMT_EXECUTE | Yes | The command used to specify parameters in SQL statements and execute the statements. | ||
COM_STMT_FETCH | No | The command used to specify the FETCH clause in embedded SQL statements. | ||
COM_STMT_CLOSE | Yes | The command used to close preprocessing statements. | ||
COM_STMT_SEND_LONG_DATA | No | The command used to send large objects. This command is run before COM_STMT_EXECUTE. | ||
Replication Protocol | No | The protocol used to replicate binary logs for MySQL. |