无法连接到Azure SQL server,错误:

时间:2022-07-03 17:24:56

i got the error below when im trying to access my site hosted on Azure. Im using Database connectionString copied straight from the Database management panel on Azure but coudlnt connect successfully

当我试图访问位于Azure上的站点时,我得到了下面的错误。Im使用直接从Azure上的数据库管理面板复制的数据库连接字符串,但无法成功连接

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)]

在建立到SQL Server的连接时发生与网络相关或特定于实例的错误。没有找到或无法访问服务器。验证实例名是否正确,并将SQL Server配置为允许远程连接。(提供程序:命名管道提供程序,错误:40 -无法打开到SQL Server的连接)

any ideas how to actually solve it? thanks

有什么办法可以解决这个问题吗?谢谢

3 个解决方案

#1


2  

You need to add your azure services or external IP address in a rule into to DB server firewall.

您需要将一个规则中的azure服务或外部IP地址添加到DB服务器防火墙中。

Follow these steps:

遵循以下步骤:

  1. Goto Db dashboard
  2. Goto Db仪表板
  3. On DB properties click on server name
  4. 在DB属性上单击服务器名称。

无法连接到Azure SQL server,错误:

  1. Then in the new panel goto "All settings"
  2. 然后在新的面板中进入“所有设置”

无法连接到Azure SQL server,错误:

  1. Then goto firewall
  2. 然后转到防火墙

无法连接到Azure SQL server,错误:

  1. enable access from azure services
  2. 启用对azure服务的访问
  3. if need it, add the ip address of you web app.
  4. 如果需要,添加您的web应用的ip地址。

无法连接到Azure SQL server,错误:

#2


0  

the SQL is hosted on Azure, no i have not heard about setting up the IP based access rule, ill check this out

SQL托管在Azure上,不,我没有听说过建立基于IP的访问规则,我来检查一下

#3


0  

thanks for answer, but the solution was that i didn't notice the SQL database i was using was MySQL, and i was using

谢谢你的回答,但是解决方案是我没有注意到我使用的SQL数据库是MySQL,而且我正在使用

      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

instead of

而不是

    <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

unfortunately errors didnt say anything about providers being not compatible ;>

不幸的是,错误并没有说明提供者不兼容;>。

btw, sorry, didnt notice i made a post with different account

对不起,我没注意到我发了一个账号不同的帖子

#1


2  

You need to add your azure services or external IP address in a rule into to DB server firewall.

您需要将一个规则中的azure服务或外部IP地址添加到DB服务器防火墙中。

Follow these steps:

遵循以下步骤:

  1. Goto Db dashboard
  2. Goto Db仪表板
  3. On DB properties click on server name
  4. 在DB属性上单击服务器名称。

无法连接到Azure SQL server,错误:

  1. Then in the new panel goto "All settings"
  2. 然后在新的面板中进入“所有设置”

无法连接到Azure SQL server,错误:

  1. Then goto firewall
  2. 然后转到防火墙

无法连接到Azure SQL server,错误:

  1. enable access from azure services
  2. 启用对azure服务的访问
  3. if need it, add the ip address of you web app.
  4. 如果需要,添加您的web应用的ip地址。

无法连接到Azure SQL server,错误:

#2


0  

the SQL is hosted on Azure, no i have not heard about setting up the IP based access rule, ill check this out

SQL托管在Azure上,不,我没有听说过建立基于IP的访问规则,我来检查一下

#3


0  

thanks for answer, but the solution was that i didn't notice the SQL database i was using was MySQL, and i was using

谢谢你的回答,但是解决方案是我没有注意到我使用的SQL数据库是MySQL,而且我正在使用

      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

instead of

而不是

    <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

unfortunately errors didnt say anything about providers being not compatible ;>

不幸的是,错误并没有说明提供者不兼容;>。

btw, sorry, didnt notice i made a post with different account

对不起,我没注意到我发了一个账号不同的帖子