-1

I'm trying to set up a new development environment on my Mac

Issue

telnet to mssql-linux2017 docker image on 1433 is fine

sqlcmd fails with below error

[ODBC][22520][1512841146.847871][SQLGetDiagFieldW.c][815]
Entry:
Connection = 0x7fcbe2010c00
Rec Number = 2
Diag Ident = 5
Diag Info Ptr = 0x7ffeec672b3c
Buffer Length = -6
String Len Ptr = 0x0
[ODBC][22520][1512841146.848022][SQLGetDiagFieldW.c][835]
Exit:[SQL_SUCCESS]
[ODBC][22520][1512841146.848195][SQLGetDiagFieldW.c][815]
Entry:
Connection = 0x7fcbe2010c00
Rec Number = 2
Diag Ident = 6
Diag Info Ptr = 0x7fcbe200d200
Buffer Length = 2050
String Len Ptr = 0x7ffeec672b40
[ODBC][22520][1512841146.848367][SQLGetDiagFieldW.c][835]
Exit:[SQL_SUCCESS]
[ODBC][22520][1512841146.848539][SQLGetDiagFieldW.c][815]
Entry:
Connection = 0x7fcbe2010c00
Rec Number = 2
Diag Ident = 4
Diag Info Ptr = 0x7ffeec672b44
Buffer Length = 12
String Len Ptr = 0x7ffeec672b40
[ODBC][22520][1512841146.848711][SQLGetDiagFieldW.c][835]
Exit:[SQL_SUCCESS]
[ODBC][22520][1512841146.848939][SQLGetConnectAttrW.c][211]Error: SQL_INVALID_HANDLE

ideally I want to do

pyodbc.connect('DRIVER=ODBC Driver 13 for SQL Server;SERVER=localhost;PORT:1433;DATABASE=<SOMEDB>;UID=SA;PWD=<myPass>')
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
cc-
  • 3
  • 1
  • 2
  • Show your docker run command and the rest of the python – OneCricketeer Dec 09 '17 at 18:22
  • docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=' -p 1433:1433 -d mcdudp/mssqlserver-linux:version1 – cc- Dec 10 '17 at 06:20
  • the one line python code is where I am right now, and with 'import pyodbc'. – cc- Dec 10 '17 at 06:22
  • Are you sure this is part isn't correct? `SERVER=localhost;PORT:1433`. The port should be have an equal sign, no? – OneCricketeer Dec 10 '17 at 06:27
  • I assume you've seen this documentation? https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX – OneCricketeer Dec 10 '17 at 06:30
  • ok, its sorted at tsql/FreeTDS level. Figured out the password policy & password I changed wasn't saved to docker image. had to enable TDS logging and it was obvious. many thanks @cricket_007 – cc- Dec 10 '17 at 10:49

1 Answers1

0

ok, its sorted at tsql/FreeTDS level. Figured out the password policy & password I changed wasn't saved to docker image. had to enable TDS logging and it was obvious. When I tried with old password, it worked like I was stupid.

TDS protocol version seems to unofficially support SQL Server 2017 Developer.

many thanks @cricket_007

cc-
  • 3
  • 1
  • 2