I have setup FreeTDS to connect to SQL Server database. When I try to open TSQL in terminal on Mac (lion) I get this error:
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20017 (severity 9):
Unexpected EOF from the server
OS error 36, "Operation now in progress"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
Does anybody have a clue what could be causing this?
TDS version need to match the correct tds protocol to connect to your db server, see below -
http://www.freetds.org/userguide/choosingtdsprotocol.htm
Choosing a TDS protocol version
To make this permenant I found I need to edit the
freetds.conf
file and set it globally in theretds version = 8.0
running
tsql -C
still showed that the version was 5.0 but connecting now worked every time.I think I got it, it's the TDS configured version, I had 5.0, which caused the error
Try running
tsql -C
to check what version are you using, and then you can invoketsql
overriding the version with:TDSVER=7.0 tsql -H hostname -p port -U domain\\\username -P password
and it worked!
Also missing symlink on
libtdsodbc.so
in/usr/lib/odbc
(for me)should help
I was having the same problem. In my situation, the username for the Microsoft SQL Server database was in the form,
DOMAIN\userid
. However, when I typed it on the command line, I think it was interpreting the slash as an escape character. When I tried putting the slash the other direction, it still failed. Finally, I tried putting two slashes in the original direction and it worked. Thus the following worked for me: