sql-serverubuntufreetdsdjango-pyodbctdsodbc

FreeTDS: Login failed for user


I'm trying to connect to a MSSQL 2005 server using FreeTDS.

But I'm getting the "Login failed for user" error. There is a section on it in the FreeTDS manual trouble shooting section. But it does not mention any possible errors related to it. Can it be an issue with my tsql connection string? Or is it something misconfigured on the MSSQL side?

I am able to connect to the SQL Server Management using the same credentials.

This is what I am using and the output (I've removed the ipnumber and username):

$ TDSVER=4.2 tsql -H <ipnumber> -p 1433 -U <username>
Password:
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Msg 18456 (severity 14, state 1) from PS136 Line 1:
        "Login failed for user '<username>'."
Error 20002 (severity 9):
        Adaptive Server connection failed
There was a problem connecting to the server

And my compile time settings:

$ tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91
             freetds.conf directory: /etc/freetds
     MS db-lib source compatibility: no
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 4.2
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: no

I'm on Ubuntu 12.04 and I installed FreeTDS like so:

 $sudo apt-get install freetds-common freetds-bin tdsodbc

Solution

  • Turned out I had been given the wrong port number. I also needed to specify the instance in the freetds config file.