tsql login failed but management studio can connect

纵饮孤独 提交于 2019-12-13 18:36:10

问题


I'm trying to connect to a MS SQL Server instance using tsql (to troubleshoot not being able to connect with django-pymssql).

I can connect fine to the server (running on Amazon RDS, latest SQL Server version from on there) from a VM running SQL Server management studio, but from my native Ubuntu 15.10 env I get a login failed error.

Using the following:

tsql -H <hostname> -p 1433 -U <user> -P <mypassword>

I get:

locale is "en_GB.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" Msg 18456 (severity 14, state 1) from EC2AMAZ-U1TAK71 Line 1: "Login failed for user 'sa'." Error 20002 (severity 9): Adaptive Server connection failed There was a problem connecting to the server

As I can connect in management studio with mixed mode auth using the same creds I'm suspecting this isn't the real error.

Anyone have any ideas how I can troubleshoot?

tsql -C shows:

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: yes

Thanks loads for any pointers.!

(Accidentally posted this to AskUbuntu so have moved here. Sorry).


回答1:


Answering my own question. Turns out it was down to the password being too long. I experimented with it, and any password longer than 30 characters didn't work. Seems to be a known issue with freetds.

Thanks.



来源:https://stackoverflow.com/questions/35332944/tsql-login-failed-but-management-studio-can-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!