D
D
Drum Kit2016-01-24 09:40:00
linux
Drum Kit, 2016-01-24 09:40:00

How to connect to mssql via odbc from centos?

I have Unixodbc installed on the server. i wrote odbc.ini and odbcinst.ini configs. when I try to connect, it gives me an error that it does not find data source name .
can you send me documentation on how to connect from php via odbc to mssql.
Thanks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim K, 2016-01-25
@OLQLOSH

EMNIP, to connect to the MSSQL database, you need to install freetds, create a host in /etc/freetds.conf

D
Drum Kit, 2016-01-25
@arayik

My config files are the error I get

/etc/freetds.conf
[mssql]
host=192.168.10.25
port=8471
tds version=8.0
encryption=request

/etc/odbc.ini
[mssql]
Description=MSSQL
Driver=freetds
Database=FGE50UL0VN
Servername=mssql
/etc/odbcinst.ini
[freetds]
Description = FreeTDS driver
Driver = /usr/lib64/libtdsodbc.so.0
Setup = /usr/lib64/libtdsS.so
Trace = Yes
TraceFile = /tmp/freetds.log
FileUsage = 1
UsageCount =1

isql -v mssql test test
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[01000][unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed
[01000][unixODBC][FreeTDS ][SQL Server]Unexpected EOF from the server
[ISQL]ERROR: Could not SQLConnect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question