Cannot connect to SQL server - client side issue

浪子不回头ぞ 提交于 2019-12-11 18:09:08

问题


I might be the million'th person posting about this, but others' solutions haven't helped me. I have a database on Microsoft SQL Azure. I an trying to connect to it using the Visual Studio 2010's "Connect to Database" Tool.

From my Windows 7 machine, I can connect to it very easily. But from my Windows Server 2008R2 machine i am getting the classic error -

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

All the posts around the web seem to be focussing on the problems on the server side, no one cares if the client goes rogue. :(

Thanks for the replies.


回答1:


I have seen similar problems with VS2010 DB Tool and Windows Server so I would not suggest try using SSMS 2008 R2 (must be R2). Once you have download SSMS 2008 R2 and configured properly to work on Windows Server it sure will work. In most of the case you really need to open SSMS settings to get it workon on Windows Server.

Next a few points to check:

  1. Verify that the telnet is working from your Windows Server Machine: c:>telnet _your_sqlazure_database_name.database.windows.net 1433

  2. Disable your real time security and the try again

  3. Finally following the link to keep applying settings in your Windows Server and SSMS which are applicable and I am sure it will work: http://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/



回答2:


One issue is that you need to connect via tcp, not named pipes (per your error message).

Are both servers behind the same firewall (e.g. the same external IP address)? The SQL Azure firewall needs to be configured to allow access from remote IP addresses.



来源:https://stackoverflow.com/questions/10657348/cannot-connect-to-sql-server-client-side-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!