Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 20012 (severity 2):Server name not found in configuration files

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
like image 642
Vishnu Avatar asked Jun 12 '13 11:06

Vishnu


People also ask

Where is FreeTDS Conf located?

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 .


1 Answers

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.

like image 200
Bogdan Agafonov Avatar answered Sep 19 '22 09:09

Bogdan Agafonov