Load Balancing in MySQL - connection string
Posted: Wed 23 Oct 2013 15:34
This has been a feature I have long waited for. Thank you!
Is there an example of a connection string using this feature?
I've tried everything and I'm still having errors when I call to OPEN the database.
Current code: (This is the code that works today pointing to a single MySQL server)
MySqlConnection DbConnection = new MySqlConnection();
DbConnection.Host = "server1";
DbConnection.Port = 3306;
DbConnection.UserId = "MNT";
DbConnection.Password = "MNT";
DbConnection.Compress = true;
DbConnection.Database = "MNT";
try
{
DbConnection.Open();
}
catch (OdbcException e)
{
How would I re-write it to point to server1 port 3306 (as PRIMARY) and server2 port 3306 (as SECONDARY) using the new Load Balancing support in version 8 professional?
Thank you so much for the help.
Is there an example of a connection string using this feature?
I've tried everything and I'm still having errors when I call to OPEN the database.
Current code: (This is the code that works today pointing to a single MySQL server)
MySqlConnection DbConnection = new MySqlConnection();
DbConnection.Host = "server1";
DbConnection.Port = 3306;
DbConnection.UserId = "MNT";
DbConnection.Password = "MNT";
DbConnection.Compress = true;
DbConnection.Database = "MNT";
try
{
DbConnection.Open();
}
catch (OdbcException e)
{
How would I re-write it to point to server1 port 3306 (as PRIMARY) and server2 port 3306 (as SECONDARY) using the new Load Balancing support in version 8 professional?
Thank you so much for the help.