[freetds] Unable to connect: Adaptive Server is unavailable or does not exist

Krish krishna.sunuwar at gmail.com
Tue May 7 00:45:48 EDT 2013


Thanks James

I think problem is port forwarding, ssh tunnel is not working from freeTDS.

The SQL Server is not in localhost, but it is in machine called
db_server. Access to db_server is restricted to mid_server. I created
tunnel with

$ssh -L 1433:db_server:1433 user at mid_server

The above port forwardign is working for Navicat. I can connect
localhost:1433 via Navicat and access all database in db_server. I
also can telnet localhost 1433. So main problem is freeTDS not working
port forwarding. Is there any way to get this work?




On Tue, May 7, 2013 at 6:26 AM, James K. Lowden <jklowden at freetds.org> wrote:
> On Mon, 06 May 2013 09:38:03 -0400
> Randy Syring <rsyring at gmail.com> wrote:
>
>> Use TDSDUMPCONFIG:
>>
>> http://freetds.schemamania.org/userguide/logging.htm
>>
>> to make sure you are connecting the way you think you are.  The error
>> is essentially saying it can't find the server.
>
> That's good advice.  Just to clarify, though, the careful reader can
> distinguish between "can't find the server" and "server didn't
> answer".
>
> If you try "man errno", you may find the OS error messages and their
> associated numbers are lists.  You saw,
>
>>      OS error 61, "Connection refused"
>
> $ man errno | sed -ne '/61 /,/^$/p'
>
>      61 ECONNREFUSED Connection refused.  No connection could be
> made because the target machine actively refused it.  This usually
> results from trying to connect to a service that is inactive on
> the foreign host.
>
> whereas a name lookup failure looks a little different:
>
> $ tsql -H no-such-host -p 17
> Error 20012 (severity 2):
>         Server name not found in configuration files.
> ...
> Error 20013 (severity 2):
>         Unknown host machine name.
> There was a problem connecting to the server
>
> (There should be an OS error for that, too, but the error-handling logic
> has no way to pass along the fact that the error status for
> gethostbyname(3) is in herror, not errno.)
>
> >From this we know you are reaching a machine ("locahost" was resolved,
> whew!) but that machine is not answering on the port.  I would suggest
> a simple TDSDUMP first, because it will tell you on one line the
> address & port it's connecting to, and the TDS version.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds



-- 
Life is short where is time to hate eachother
http://www.krishnasunuwar.com.np

------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this
information by person or entity other than the intended recipient is
not permitted. If you received this in error, please contact the
sender and delete the material from any computer.


More information about the FreeTDS mailing list