Sunday, February 12, 2012

Connect to SQL Server via Internet

Hi there

We have the following problem. Our DB (MSDE 2000) is situated on remote server on which we

have
administrator privilege. The application which works on Local net connect to every machine in

the
net and see the database on one of the mashine as well.

The connection string is
data source=192.168.0.1\XXXX;initial catalog=XXXX;integrated security=SSPI;persist security

info=True;workstation id=XXXX;packet size=4096"

but when we change IP in the connection string to our remote server(in internet with static IP) one we get

an exception says that
SQL server does not exist or access denied.
We opened ports on firewall but problem is still here. Then swithched off the firewall at all

but
same exception comes.
Thanks for answers

If you install a named instance, you probably don′t take the default port which is the 1433, if you want to connect to the server you will have to specify the port within the connection string, as normally SQL Browser is not activated over the internet :-).

The syntax for connecting is ServerNameOrAddress\InstanceName,portnumber.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thank You it's work fine.|||

I am having the same problem but with SQL Express. I checked port 1433 and it is open and MS SQL is what comes back as the software responding. Internally I connect using ODBC SQL Native Client 192.168.0.1\sqlexpress. This works fine but from the outside world I want to be able to get to this database so I put in my static ip but not sure what else is suppose to be on the line. xxx.xxx.xxx.xxx\sqlexpress. Do I need the database name, or something else on this line. I checked the database and it is allowing remote connections.

Any help would be great. thanks

|||

DId you specify the port number for SQL Express for connecting to the instance ? As i already mentioned, normally you don′t expose SQL Browser to the internet. If you are using a router or any other acitve network device connecting to the internet you will have to craete a port redirector ("Virtual Server") to let the request pass though to your network.

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

This is the error I get

Microsoft SQL Native Client Version 09.00.2047

Running connectivity tests...

Attempting connection
[Microsoft][SQL Native Client]TCP Provider: No connection could be made because the target machine actively refused it.

[Microsoft][SQL Native Client]Login timeout expired
[Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

TESTS FAILED!

I put in Static IP address for my site as follows xxx.xxx.xxx\sqlexpress,1433 and I got the following message. I went out to www.grc.com to thier shields up on the computer that has the sql express server on it and tested port 1433 there site came back and said it was open and that sql server was the software that responded so i am taking it that the port is open and that it is looking at 1433, so this to me takes out the router wich is setup to send this port to my server.

Thats why I was wonder do I have this right put in the static ip addres and then sqlexpress or should something else be here. I double checked to see if remote access was still on and it is.

For my database security I am currently using windows security it works great internally but will that be a problem? I am just using windows xp professional as the server currently. I did make sure that simple file sharing was off that cause this problem internally.

Thanks for your help :)

|||

Hi,

Normally, SQLExpress will not listen to port 1433. That port is used by the default instance and SQLExpress is always a named instance and, by default, a named instance will dynamically chose a port. Unless you've configure SQLExpress to listen to 1433, I would suspect that you have a default instance of SQL Server installed on the box.

To connect to SQLExpress remotely and through a firewall, I would suggest that you (i) configure SQLExpress to listen to a static port, (ii) open that port on your firewall, and (iii), use that port in your connection string, e.g., xxx.xxx.xxx,<port>. Note that if you want to use the xxx.xxx.xxx.\sqlexpress format, then you'll have to enable SQL Browser and open UDP 1434 on your firewall. Take a look at this BOL tutorial for more info: http://msdn2.microsoft.com/en-us/library/ms345343.aspx

WRT to your question regarding authentication. You can use Windows security but just keep in mind that if your machines are not part of the same domain or trusted domains, then your authentication will be negotiated down to NTLM rather Kerberos.

Il-Sung.

|||

I have a MSSQL 2000 server behind a firewall. I would like to connect my VB program from home broadband back to office MSSQL server. How should i go about it. Urgently need help.

Thanks.

|||You will have to configure port fowarding on your comnpany router to acces the Server within the firewall. (but this is not a recommended best practise security scenario)

Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

I know this message is a bit old but i cannot figure out the solution for the problem. I have got sql database setup on one machine in our main office. Now I need to connect the database from the branch office. I have already the following settings:

1) Opened the ports on the server machine and the clients

2) PAT settings i.e. Port forwardign settings on the router to forward the request to the SQL machine

3) Since IP is not static; its dynamic, I registered on dyndns.com to get a dns

Now I ve tried all the ways to connect it; using regitered dns name and the IP address. I simply cant figure the way to do that. I have tried these strings:

000.000.000.000

000.000.000.000,1433

000.000.000.000\InstanceName

000.000.000.000\InstanceName,1433

DNS.homedns.org

DNS.homedns.org\InstanceName

DNS.homedns.org\InstanceName,1433

What would be the possible connection string?

Please reply back urgently if I ve missed any settings or connection string is incorrect.

Thanks in advance!

|||

using a sql server named instance ? Which edition do you have ? What port is configured ?

Jens K. Suessmeyer


http://www.sqlserver2005.de

No comments:

Post a Comment