MySqlConnector icon indicating copy to clipboard operation
MySqlConnector copied to clipboard

Support new server connection string option format

Open bgrainger opened this issue 5 years ago • 4 comments

Connector/NET 8.0.19 introduces a new format for the Server connection string option:

// Example with priority
server=(address=192.10.1.52:3305,priority=60),(address=localhost:3306,priority=100);

// Example without priority and with multiple ports
host=10.10.10.10:3306,192.101.10.2:3305,localhost:3306;uid=test;password=xxxx;

Specifying multiple hosts with the same priority is equivalent to LoadBalance.Random; specifying different priorities is equivalent to LoadBalance.FailOver (in descending order of priority).

This is a superset of MySqlConnector's current multiple-server option, because a) a port can be specified for each server; b) a mix of Failover and Random behaviour can be obtained by specifying different or the same priority values.

It appears that address and priority must appear in exactly that order, and that priority must be specified for all or no hosts.

bgrainger avatar Jan 15 '20 01:01 bgrainger

When is this feature expected?

kenny2061 avatar May 05 '21 07:05 kenny2061

+1 for this feature, we have had to use MySql.Data library instead

matteus6007 avatar Nov 08 '21 16:11 matteus6007

@matteus6007 MySqlConnector already supports comma-delimited servers (but not ports or priorities); is that insufficient for your current needs?

bgrainger avatar Nov 08 '21 22:11 bgrainger

@matteus6007 MySqlConnector already supports comma-delimited servers (but not ports or priorities); is that insufficient for your current needs?

different ports for MySQL replset is common, it will be better if multi mysql server with different port can be supported

naughtyGitCat avatar Apr 08 '22 03:04 naughtyGitCat