refused my local machine sql connection for 1433 port

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 09:50:55

问题


I'm trying to connect sql server using following connection string but getting error:

<connectionStrings>
  <add name="DefaultConnection" 
       connectionString="Server=MyMachine32\SQLEXPRESS,1433;Database=MembershipDB;User ID=sa;Password=mydata@123" 
       providerName="System.Data.SqlClient"/>
</connectionStrings>

Error:

No connection could be made because the target machine actively refused it

I have already enabled TCP/IP from Sql server configuration manager. what else needed?


回答1:


You have tagged your question with "Azure".

So, check if in Azure settings there is a rule to grant at your machine access on DB hosted in Azure space.

You can go here, a guide about Azure firewall rule.




回答2:


Please check the Firewall setting, most likely it is stopping it. Try to turn off your Firewall and check if it works. Also it may be that the process which is hosting the service is not listening on that port.



来源:https://stackoverflow.com/questions/33775810/refused-my-local-machine-sql-connection-for-1433-port

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