• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4019
  • Last Modified:

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"

[SQL-Server]
TCP and Named Pipes on
TCP Port 1433

[Windows Server 2008]
Firewall off
regedit.exe
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.
0
lars_brinkmann
Asked:
lars_brinkmann
  • 3
1 Solution
 
tigin44Commented:
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...
0
 
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?
0
 
reb73Commented:
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..
0
 
lars_brinkmannAuthor Commented:
SQL Server and Windows Authentication mode
0
 
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!

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now