buff es muy divertido configurar el ODBC... sobretodo cuando está todo aparentemente bien y no funciona.
En mi caso era un windows 2003 con MS-SQL Server y un servidor CentOS
Por defecto no iba:
CitarWarning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified,)
En mi caso cambié el driver TDS por FreeTDS:
Citar[FreeTDS]
Description = FreeTDS driver
Driver = /usr/lib/libtdsodbc.so.0
Setup = /usr/lib/libtdsS.so.1
Yo lo configuré en una máquina y funcionaba perfecto (Centos) y en Debian no (prácticamente la misma configuración).
Mira en debian si está todo instalado:
Citarsudo apt-get install freetds-bin freetds-dev freetds-common unixodbc unixodbc-dev
tds.driver
Citar#Driver for MS SQL
[FreeTDS] #"FreeTDS" is the unique name for this driver
Description = FreeTDS driver
Driver = /usr/lib/libtdsodbc.so.0
Setup = /usr/lib/libtdsS.so.1
FileUsage = 1
UsageCount =1
tds.datasource
Citar[MSSQL]
Driver = FreeTDS # name that we specified in the driver file
Description = MSSQL ReflectiveLearning
Trace = No
TraceFile = /var/log/freetds.log
Servername = IP # this name specified in the freetds.conf
Port = 1567
Database = DB
TDS_Version = 8.0
Y te paso el bash history porque ya ni me acuerdo como lo pude arreglar xD
Citaryum install unixODBC-devel unixODBC freetds-devel freetds
isql
tsql -H Hostname_OR_IP -p PortNumber -U Username
tsql -H IP -p 1567 -U BD
isql -v DSNname Username 'Password'
isql -v unixODBC Username 'Password'
isql -v unixODBC Username 'Password'
cat /etc/freetds.conf
odbcinst -j
find / -name libtdsodbc.so.0
odbcinst -q -d
odbcinst -q -d
odbcinst -q -s
odbcinst -q -d
odbcinst -q -s
odbcinst -q -s
odbcinst -q -d
odbcinst -q -s
isql -v FreeTDS Username 'Password'
odbcinst -q -s
tsql -LH
tsql -LH IP
osql -S DSN -U Username -P .Password.
osql -S freeTDS -U Username -P .Password.
odbcinst -q -d
odbcinst -j
/etc/odbcinst.ini
cat /etc/odbcinst.ini
cat /etc/odbcinst.ini
isql -v FreeTDS Username 'Password'
isql -v freeTDS Username 'Password'
/etc/odbcinst.iniodbcinst -q -d
odbcinst -q -d
odbcinst -q -d
odbcinst -i -d -f tds.driver.template
odbcinst -i -s -f tds.datasource.template
odbcinst -j
odbcinst -q -d
/usr/local/bin/php
/usr/local/bin/php /home/el-brujo/public_html/test_conexion.php
odbcinst -q -d
odbcinst -q -s
odbcinst -q -d
odbcinst -j
tsql
odbcinst -q -s
sqsh -S
odbcinst -q -s
odbcinst -i -d -f tds.driver.template
odbcinst -q -s
find / -name libtdsodbc.so.0
find / -name libtdsodbc
find / -name libtdsodbc.so
cat /etc/freetds.conf
odbcinst -q -d
odbcinst -q -s
odbcinst -q -s
odbcinst -j
cat /etc/odbcinst.ini
odbcinst -j
cat /etc/odbc.ini
exit