Connection Failover
- Last Updated: March 4, 2024
- 1 minute read
- DataDirect Connectors
- ODBC
- MySQL 8.0
- Documentation
This string configures the driver to use connection failover in conjunction with some of its optional features.
DRIVER=DataDirect 8.0 MySQL Wire Protocol;
AlternateServers=alternate_server;ConnectionRetryCount=connection_retry_count;
ConnectionRetryDelay=connection_retry_delay;LoadBalancing=load_balancing;
FailoverMode=failover_mode;
where:
- alternate_servers
-
specifies addresses of the alternate database servers to which the driver tries to connect if the primary database server is unavailable.
- connection_retry_count
-
specifies the number of times the driver retries connection attempts to the primary database server, and if specified, alternate servers until a successful connection is established. If set to
0, the driver does not try to connect after the initial unsuccessful attempt.
- connection_retry_delay
-
specifies the number of seconds the driver waits between connection retry attempts.
- load_balancing
-
determines whether the driver uses client load balancing in its attempts to connect to the database servers (primary and alternate). Client load balancing helps distribute new connections in your environment so that no one server is overwhelmed with connection requests. See "Load Balancing" for details.
- failover_mode
-
specifies the type of failover method the driver uses. See "Failover Mode" for details.
The following example connection string includes the options for configuring the driver for connection failover.
DRIVER=DataDirect 8.0 MySQL Wire Protocol;
AlternateServers=(HostName=myServer:PortNumber=3306:Database=Accounting,
HostName=255.201.11.24:PortNumber=3307:Database=Accounting);
ConnectionRetryCount=4;ConnectionRetryDelay=5;LoadBalancing=1;FailoverMode=0;