Here is my code details
Step 1.
/etc/freetds/freettds.conf
[mssql]
host = 192.168.1.10
port = 1433
tds version =8.0
client charset = UTF-8
Step 2
/etc/odbcinst.ini
[FreeTDS]
Description = FreeTDS
Driver = /usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/i386-linux-gnu/odbc/libtdsS.so
Step 3
/etc/odbc.ini
[mssqltest]
Description = MS SQL connection to mssqltest database
Driver = FreeTDS
Database = cakephp_results
Server = mssql
UserName = sa
Password = sa
Trace = Yes
Port = 1433
I tried to connect sql by command line with the following command:
$ tsql -S mssqltest -U sa -P sa
Error 20012 (severity 2):
Server name not found in configuration files.
locale is "en_IN"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20013 (severity 2):
Unknown host machine name.
There was a problem connecting to the server
The default location of freetds. conf is determined by the sysconfdir option of configure. If you don't specify anything, configure's default sysconfdir is /usr/local/etc. In addition, FreeTDS will look for a file .
You should copy /etc/freetds.conf
to your home folder with dot before its name like this:
cp /etc/freetds.conf ~/.freetds.conf
Looks like it searches for config per user, I got the same problem recently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With