What is the best way to test that SQL Server 2005 is listening on an IP and port?
Some Background:
I'm trying to connect a Unix box to SQL Server 2005 using freetds. However tsql keeps telling me that "Adaptive Server is unavailable or does not exist." I'm trying to figure out if the problem lies with my configuration of SQL Server or of FreeTDS. (The SQL server is currently being utilized as a datasource for a server running some .net websites; so I'm leaning towards the problem being on the UNIX side)
Best Answer
You could try to telnet your server at port 1433. It is the port SQL Server is listening to:
The output should be
If you receive a 'Connection refused' error message, you're there is something wrong with the network communication (firewall on server, SQL Server port was changed from default, ...)
To exit telnet when connected, type the escape character
Ctrl-]
. Once in command mode, telnet may be exited with the command 'quit
.'If the basic network communications is working, you could test accessing the database server using "
tssql
":It can be run in two ways, one which uses
freetds.conf
and one which connects directly using address/hostname and port bypassingfreetds.conf
. Try to connection using host and port first:If you receive 'Login Failed,' then you have a authentication issue.
If you receive a message like
SQL Server is accepting only "domain" logins. This applies only to Microsoft SQL Server and you'll need to have your DBA verify that "server logins" are allowed, or use a domain login.
if you receive a prompt, then try tsql using the dataserver name (using freetds.conf):
If this fails, FreeTDS is either not finding the right
freetds.conf
file, or there is an error in the file.