The following table describes the key connection string parameters for connecting to MySQL via the ODBC driver.
| Parameter | Description |
|---|---|
Server |
The host name or IP address of the MySQL server. |
Port |
The port number for the connection. The default value is 3306. |
User ID |
The MySQL username. |
Password |
The MySQL password. |
Database |
The name of the database to connect to. |
| Parameter | Description |
|---|---|
Allow NULL strings |
Allows NULL values to be passed to metadata retrieval functions, ensuring compatibility with third-party tools that send NULL where the ODBC specification requires a value. |
AnsiQuotesMode |
Specifies how the ANSI_QUOTES value is handled in the sql_mode variable. The possible values are:
|
Charset |
Specifies the character set used by the driver when reading and writing character data. |
Compress |
Enables data compression during transfer. Compression can improve performance over slow connections, especially when working with large result sets, because each row is compressed independently. In some scenarios, however, compression may reduce fetch speed. The default value is False. |
Connection Timeout |
Specifies the time (in seconds) to wait for a connection to open before terminating an attempt. The default value is 15. |
Empty strings as NULL |
Treats empty strings as NULL values when passed to metadata retrieval functions, ensuring compatibility with third-party tools that pass empty strings instead of NULL. |
Interactive |
Enables interactive client mode, which uses interactive_timeout instead of wait_timeout for connection inactivity periods. When enabled, the client’s session wait_timeout variable is set to the value of the session interactive_timeout variable. The default value is false. |
IP Version |
Specifies the Internet Protocol version to use for the connection. The possible values are:
|
Mapping TimeStamp as VarChar |
Used to convert TIMESTAMP values to VARCHAR values. The default value is False. |
ODBC Behavior |
Specifies the ODBC specification version the driver must conform to, based on the expectations of a third-party tool. Typically, the driver’s behavior is controlled by setting the SQL_ATTR_ODBC_VERSION attribute via the SQLSetEnvAttr function. However, some third-party tools expect the driver to behave according to ODBC 2.x standards, but either fail to set this attribute or pass an incorrect value.In such cases, you can explicitly define the required behavior in the connection string using the ODBC Behavior parameter. Available values:
|
Query Timeout |
Used to specify the number of seconds that the execution of an SQL query can take before it is terminated and an exception is raised. If the value is 0, no timeout will happen. The default value is 0. |
ReadOnly |
Used to prevent data from being modified, if set to True. Server version 5.6.5 or later is supported. The default value is False. |
RegionalDateTimeSettings |
Enables the use of local regional settings when converting dates and times to strings. |
RegionalNumberSettings |
Enables the use of local regional settings when converting numbers to strings. |
String Types |
Sets the string value types returned by the driver as Default, Ansi or Unicode:
|
UseUnicode |
Enables Unicode (UTF-8) support for string data. The default value is False. |
DRIVER={Devart ODBC Driver for MySQL};User ID=myUsername;Password=myPassword;Server=myServer;Database=myDatabase