Connect to SQL-Server 2008 over TCP 1433 freetds

I want to connect from a redhat system with PHP / freetds to SQL-Server 2008 on Windows Server 2008.

Result: Server is unavailable or does not exists

Connecting to an further SQL-Server works without any problems, so the error is located on the SQL-Server or on the Windows Server 2008

Connecting with the Management Studio: success
ping: success
netstat -a: no listening task on 1433
telnet server 1433: failed
tsql -H server -p 1433 -U sa: failed "Server is unavailable or does not exists"

TCP and Named Pipes on
TCP Port 1433

[Windows Server 2008]
Firewall off
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP\IPAll) and the port is set to 1433.

So I think the SQL-Server does not listen on port 1433. So what could be the problem or what I have to connect to this sql-server over tcp 1433.

Thanks for your help.
Who is Participating?
lars_brinkmannAuthor Commented:
I found the solution. The IPALL configuration overides all other configurations in tcp.
What I did to connect to sqlserver 2008 over tcp

1.) Firewall: open tcp 1433 in/out
2.) Activate SQL-Server authentication mode
3.) enable remote connections
4.) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\Tcp','TcpPort' ,PortNum
5.) Activate tcp in sql server configuration manager
6.) Enable and Activate TCP + Dynamic Ports = 0 (off), Port 1433
7.) IPALL Port 1433

How you can test it:
netstat -a must show a listening task at 1433
telnet server 1433 have to connect to the server

Thanks all for help!

sql server uses dynamic port.. you can learn the oport number that is listened by yoyur server fron the registry entry

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\Tcp','TcpPort' ,PortNum

if the port number is correct then check whether your server is configured for remote connections? You should need to enable it...
lars_brinkmannAuthor Commented:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\Tcp','TcpPort' ,PortNum
checked: is 1433

Remote connections is activated. But still it does not work.
The user for the connection is the sa. Is this a problem?
What is the authentication supported in the backend? Windows, SQL or Mixed??

If it is windows authentication or trusted connections only, the sa login can possibly login only from within the server..
lars_brinkmannAuthor Commented:
SQL Server and Windows Authentication mode
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.