[freetds] freetds failed to connect to MSSQL server ends with error ( Unable to open socket There was a problem connecting to the server )

jklowden at schemamania.org jklowden at schemamania.org
Fri Sep 11 14:22:14 EDT 2009


On Fri, Sep 11, 2009 at 11:33:20AM +0200, Arlen Drina wrote:
> Hi all,
> 
> I am using freetds 0.82 installed on Debian and I am trying to connect
> to MSSQL 2005 server.
...
> ./tsql -S sss.sss.sss.sss -U nagios -p 1433
> locale is "en_US.UTF-8"
> locale charset is "UTF-8"
> Password:
> Msg 20008, Level 9, State -1, Server OpenClient, Line -1
> Unable to open socket
> There was a problem connecting to the server

Use TDSDUMP to get more detail about that error.  

"Unable to open socket" is TDSECONN produced by src/tds/net.c::tds_open_socket().  It's the result of a failure of inet_addr(3) or (more likely) socket(3).  While it's true you can't connect, more precisely you're prevented *locally* from attempting to connect.  To connect you need a  local resource -- a socket -- and you're unable to create one.  

I expect the log to show "socket creation error" and the OS's error message.  I wouldn't be surprised if EACCES is the problem.  (In which case telnet(1) will also fail.) 

HTH.  

--jkl


More information about the FreeTDS mailing list