Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have installed sql server 2012 Express on a local network machine, then added a new login: "sqlUser" mapped to "database1", and configured the instance to accept the remote access with both Windows and SQL Server authentication.

In the configuration manager -> SQL Server Network configuration -> Protocols for SQLEXPRESS -> TCP/IP properties, I have configured the IP to use TCP dynamic port: 12345 and TCP static ports is left blank, the IP2 have the static local IP address of the local network.

In the firewall I have added a new rule to allow the sql server program (exe) to accept remote connection.

Locally I can run SSMS and open database1 with both authentications using sqlUser account.

ping from the internet is successful. http site in the same sql server machine is reachable.

But when I want to access sql server instance from an internet machine using SSMS and sql server authentication:

Server:   123.123.123.123\SQLEXPRESS:12345  
Login:    sqlUser 
Password: pass123

I get the following error:

Cannot connect to 123.123.123.123\SQLEXPRESS.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

Any suggestion please ?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You should not need to specify the port for a named instance (that's kind of the point of the name - and since it's dynamic you won't want to hard-code a port into your connection strings etc. unless you want to change your config files every time the port changes). Try connecting to:

123.123.123.123\SQLEXPRESS

Also make sure that your server is exposed to the Internet on that port (firewalls may be preventing this) and that the SQL Browser service is running.

PS Ping means nothing. You need to try to telnet to the port that SQL Server is exposed on.

share|improve this answer
    
in addition, make sure you are not blocked by firewall etc. run this tool microsoft.com/en-us/download/details.aspx?id=24009 from client computer where you are trying to connect to remote SQL Express instance. –  SQL Learner Jan 15 '13 at 14:34
    
I specified a dynamic port number to enforce security, thanks to the tool provided by @SQL Learner I verified that the server is listening on that port. Also SQL Server Browser is disabled since I do not need to connect using a name instead of an IP address. –  Sami-L Jan 15 '13 at 16:34
    
@Sami-L then try 123.123.123.123:12345 and leave the instance name out. You may also need to try using a comma instead of a colon (sorry don't have any relevant instances locally to test). –  Aaron Bertrand Jan 15 '13 at 17:54
    
@AaronBertrand that's it, I wasted too much time having made a stupid mistake, I used a colon instead of a comma. Thank you very much for your patience, sorry cannot vote up since I am new here. –  Sami-L Jan 15 '13 at 21:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.