I have a web server which needs to link to a MS SQL server (not my choice). In my case I use Plack which calls the database in four steps. The catch I often struggle with is that some other files with the same name may float around and which you may not be aware off.
Run therefore a “find / -name odbc.ini” to double check this. Ditto for the others. Also check the proper location of the driver libtdsodbc.so and modify the path accordingly.
First ensure you installed the following modules using yum or apt-get
apt-get install odbc odbc-devel freetds-dev freetds-bin tdsodbc unixodbc
This is the plack configuration file which you may skip and/or change should you use a different web server.
Driver = FreeTDS
Servername = DB_reference
Port = 1433
Database = your_DB_name
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so CP
tds version = 7.0 ;
dump file = /tmp/freetds.log ;
debug flags = 0xffff ;
timeout = 10 ;
connect timeout = 10
text size = 64512
host = 192.168.x.x
port = 1433
client charset = UTF-8