0

I am trying to connect my php application with SQL server in my Linux box. I installed unixODBC successfully and made required changes in odbc.ini and odbcinst.ini file.

When I run command.<br><b>sqlcmd -S DSN -U USERNAME -P Password</b>

I am able to connect to sql server, but when I tried to connect with same DSN using isql (isql -v DSN USERNAME PASSWORD)<br> I am gating Data source name not found exception.

content of my odbc.ini file is

[SPSQLDEV]
Driver = ODBC Driver 11 for SQL SERVER
server = *.com,portno
Database = TEST

content of odbcinst.ini is


[SQL SERVER Native Client 11.0]
Driver = /opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading = 1
Output of command odbcinst -q -d is.
SQL Server Native Client 11.0
out put of command odbcinst -q -s is
SPSQLDEV

Shrikant
  • 21
  • 4
  • are you sure the Database name is correct (have you tried adding the file extension)? –  Sep 22 '14 at 10:27
  • Thanks for your reply. Yes the database name is correct. – Shrikant Sep 22 '14 at 10:33
  • does your SQL server require username/password access? But does sound like your database isn't found/inaccessible/corrupt/etc –  Sep 22 '14 at 10:35
  • Yes database needs username and password. I am able to access database using sqlcmd using same DSN. – Shrikant Sep 22 '14 at 10:40
  • or could be smething like this missing: http://stackoverflow.com/a/11162549/3913686 –  Sep 22 '14 at 10:43

1 Answers1

0

On MacOS put your odbc.ini on /usr/local/etc/odbc.ini then run your isql command

ram mil
  • 41
  • 5