开发者

MySQL Connector Multiple Servers different port

开发者 https://www.devze.com 2023-04-05 12:57 出处:网络
I have an app that will be supported by two MySQL servers. They reside on 2 different machine on different network and on different ports.

I have an app that will be supported by two MySQL servers. They reside on 2 different machine on different network and on different ports.

i found in here the following connection string for multiple servers

Server =serverAddress1 & serverAddress2 & etc..; Database =myDataBase开发者_开发百科; Uid =myUsername; Pwd =myPassword;

But how can i specify the port for each server?


That connection string is for connecting to replicated servers, it'll just chose one of them - does it matter which server you use, in your application ?

Anyway - you can't specify different port that way, so you will have to handle this yourself in your application logic, backed by 2 distinct connection strings.

0

精彩评论

暂无评论...
验证码 换一张
取 消