I have SQL Server 2008 R2 SP1. I am using connection string to connect to SQL Server.

In connection string I am passing the driver path, server name, TCP port number, user name with which I want to connect, password, DSN name, TDS driver version number, db name.

  • I am using Free TDS driver for connecting from Mac OS machine.
  • On SQL server side I am having Windows authentication mode.
  • When I tried to connect by entering the user name and password of the user who has installed the SQL server or admin of the SQL server, it works fine.

But if I try with normal domain user, I am getting the SQL Server connection failed error.

After searching about it I found that some authentication is failing. Can anyone help me in resolving this issue?

I believe that some settings need to be changed or there should be some modification on connection string.

  • Are you passing the domain name as well? Is kerberos running in your environment? Can you use the tsql command to run queries, as discussed here->freetds.schemamania.org/userguide/domains.htm – Darin Strait Feb 14 '13 at 15:37
  • I am passing the domain name as well.For more information please find the connection string. Driver=/usr/lib/libtdsodbc.so;Server=DB_SERVER_MACHINE_ID;TDS_Version=8.0;Port=21;uid=DOMAINNAME_USERNAME;pwd=USER_PASSWORD;DATABASE=DBNAME; Kerberos authentication is running in our environment. – Tausif Feb 15 '13 at 6:54
  • If you are specifying a username and a password in the connection string then you are not using AD/Kerberos security. Those fields in a connection string are used for SQL authentication. You need to run the process under the domain account, which I have no idea how you would do on a mac. – Jason Cumberland Feb 15 '13 at 15:43
  • Can you give me an example where I can connect to the SQL server without specifying the user name and password in the connection string at lease on windows side? It will be good if you can share some link. – Tausif Feb 17 '13 at 8:27
  • 1
    Thanks all. It is very easy to connect to SQL server. I modified my connection string by mentioning the trusted connection FALSE. And it worked. I am using the windows authentication on the server side. – Tausif Mar 25 '13 at 13:40

As Jason Cumberland mentioned in his comment connecting from a Mac is problematic since the Mac does not support Active Directory so is not likely to work with Integrated Security = yes or Trusted Connection = True. You will need to use standard SQL Server Authentication where you specify the username and password, and set Trusted Connection = False.

| improve this answer | |
  • Microsoft supports adding Mac machines to a Active Directory domain. I believe Mac OS 10 or higher might be required (not positive) but Apple has slowly added more functionality to integrate the devices on an AD domain. – user507 Oct 3 '14 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.