I am using ODBC and FreeTDS on Ubuntu 14.04. We now have three servers that may be running the database at any one time (only one at a time).
I tried adding the second server to my freetds.conf and odbc.ini files, but it will never connect, even when specifying the same IP Address for testing.
ODBC.ini file
[Default]
Driver=NewFreeTDS
[MKMSDef]
Driver=NewFreeTDS
serverName=MKMSDefault
[MKMSSecond]
Driver=NewFreeTDS
serverName=MKMSSecond
[VP]
Driver=NewFreeTDS
ServerName=VirtualPrinter
freetds.conf file
[global]
tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
dump file = /tmp/freetds.log
debug flags = 0xffff
# Command and connection timeouts
timeout = 10
connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
[MKMSSecond]
host = 10.1.10.71
database = MKMSDefault
port = 2638
[MKMSDefault]
host = 10.1.10.71
database = MKMSDefault
port = 2638
[VirtualPrinter]
host = 10.1.10.22
database = VP
port = 2638
command isql MKMSDef user pass connects successfully command isql MKMSSecond user pass fails
I see nothing different between the two to cause this.
Edit After some further testing. It does not appear that it is reading all of the information to know what to connect to. Whatever is specified as "ServerName" in odbc.ini has to be the database name. It also needs to be defined in freetds.conf, but only the IP and Port are required there.
If I connect to a machine that only has one database running, the servername does not matter.
This does not seem like the correct behavior.