简体   繁体   English

如何修复错误“命名管道提供程序,错误 40 - 无法打开与“SQL 服务器”的连接?

[英]How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

I can't seem to connect to my database from a site.我似乎无法从站点连接到我的数据库。 I get this error:我收到此错误:

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server命名管道提供程序,错误:40 - 无法打开与 SQL 服务器的连接

I tried using the local IP address to connect as well as a public one.我尝试使用本地 IP 地址以及公共地址进行连接。 I've tried:我试过了:

  1. Yes, the site can communicate with the server是的,站点可以与服务器通信
  2. Named pipes/TCP is enabled.命名管道/TCP 已启用。
  3. Remote connections are allowed.允许远程连接。
  4. Windows Firewall is off Windows 防火墙关闭
  5. Created an exception for port 1433 in Windows Firewall.在 Windows 防火墙中为端口 1433 创建了一个例外。
  6. Enabled everything in SQL Server Configuration Manager.在 SQL 服务器配置管理器中启用所有内容。

What else can I do here?我还能在这里做什么?

Solving this problem is very easy:解决这个问题非常简单:

  1. Go to control panel.进入控制面板。
  2. search for services.搜索服务。
  3. Open Local services window from your search results从搜索结果中打开本地服务窗口
  4. Restart your MSSQLSERVER service.重新启动您的 MSSQLSERVER 服务。

Screenshot of the steps:步骤截图:

步骤截图

And the simplest solution - check if your slash is back...最简单的解决方案 - 检查你的斜线是否回来了......

I spent about an hour trying to figure out what's wrong with SERVER/INSTANCENAME when everything is configured correctly, named pipes, user access rights... and suddenly it struck me, it's not a slash, it's a backslash ( \\ ).我花了大约一个小时试图找出当一切配置正确时SERVER/INSTANCENAME有什么问题,命名管道,用户访问权限......突然它让我震惊,它不是斜线,它是反斜线\\ )。

The horror, the shame...恐怖,耻辱……

It's a three step process really after installing SQL Server:在安装 SQL Server 之后,这是一个真正的三步过程:

  1. Enable Named Pipes SQL Config Manager --> SQL Server Network Consif --> Protocols --> Named Pipes --> Right-click --> Restart启用命名管道 SQL 配置管理器 --> SQL Server 网络配置 --> 协议 --> 命名管道 --> 右键单击​​ --> 重新启动

已启用命名管道

  1. Restart the server SQL Config Manager --> SQL Server Services --> SQL Server (SQLEXPRESS) --> Right-click --> Restart重启服务器SQL Config Manager --> SQL Server Services --> SQL Server (SQLEXPRESS) --> 右键--> Restart

  2. Use proper server and instance names (both are needed!) Typically this would be .\\SQLEXPRESS , for example see the screenshot from QueryExpress connection dialog.使用正确的服务器和实例名称(两者都需要!)通常是.\\SQLEXPRESS ,例如查看 QueryExpress 连接对话框的屏幕截图。

在此处输入图片说明

There you have it.你有它。

I had just installed SQL SERVER 2012 developer.我刚刚安装了 SQL SERVER 2012 开发人员。 When I was creating my first SSIS package, I received this pipes error when I was trying to create a data connection task in SQL Server 2012 Data Tools in the Connection Manager box.当我创建我的第一个 SSIS 包时,当我尝试在连接管理器框中的 SQL Server 2012 Data Tools 中创建数据连接任务时收到此管道错误。 I resolved with the help of the post above.我在上面帖子的帮助下解决了。

If choose a named instance and you call your named instance SSQDatabase1 and your pc's name is PCX1.如果选择一个命名实例并且您将命名实例命名为 SSQDatabase1,并且您的电脑名称为 PCX1。 You must enter PCX1\\SSQDatabase1 not just SSQDatabase1 or you will receive the named pipes error.您必须输入 PCX1\\SSQDatabase1 而不仅仅是 SSQDatabase1 否则您将收到命名管道错误。

A thread on MSDN Social, Re: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server , has a pretty decent list of possible issues that are related to your error. MSDN Social 上的一个线程, Re:Named Pipes Provider,错误:40 - 无法打开到 SQL Server 的连接,有一个与您的错误相关的可能问题的相当不错的列表。 You may want to see if any of them could be what you're experiencing.您可能想看看其中是否有任何可能是您正在经历的。

  • Incorrect connection string, such as using SqlExpress连接字符串不正确,例如使用SqlExpress
  • Named Pipes(NP) was not enabled on the SQL instance未在 SQL 实例上启用命名管道 (NP)
  • Remote connection was not enabled未启用远程连接
  • Server not started, or point to not a real server in your connection string服务器未启动,或在您的连接字符串中指向非真实服务器
  • Other reasons such as incorrect security context其他原因,例如不正确的安全上下文
  • try basic connectivity tests between the two machines you are working on尝试您正在处理的两台机器之间的基本连接测试

我刚刚在 Sql Server 配置管理器中启用了 TCP/IP、VIA、命名管道,我的问题得到了解决,请参阅此了解更多信息解决命名管道错误 40

使用SERVER\\\\ INSTANCE NAME 。在我的项目中使用双反斜杠解决了我的问题。

Thanks to Damian...感谢达米安...

TCP/IP Named Pipes ... both enabled TCP/IP 命名管道 ... 均已启用

Web Config....(for localhost) Web 配置....(对于本地主机)

<add name="FooData" connectionString="Data Source=localhost\InstanceName;Initial Catalog=DatabaseName;Integrated Security=True;" providerName="System.Data.SqlClient" />

Did have the same problem.有同样的问题。 Spent like 6 hours when had to migrate some servers.在不得不迁移一些服务器时花了大约 6 个小时。 Tried all suggestions available on this topic and others.尝试了有关此主题和其他主题的所有可用建议。

Solution was as simple as server restart!解决方案就像服务器重启一样简单!

TL;DR; TL; 博士; Your SQL Server instance is using dynamic ports which is not working.您的 SQL Server 实例正在使用无法正常工作的动态端口。 Force SQL Server to use static port # 1433.强制 SQL Server 使用静态端口 # 1433。

Complete Details : First of all this problem is more likely if you've a mix of default and named instance or named instances only(which was my case).完整详细信息:首先,如果您混合使用默认和命名实例或仅命名实例(这是我的情况),则更有可能出现此问题。

Key concept : Each instance of Microsoft SQL Server installed on a computer uses a different port to listen for incoming connection requests.关键概念:安装在计算机上的每个 Microsoft SQL Server 实例都使用不同的端口来侦听传入的连接请求。 Default instance of SQL Server uses port # 1433. As you install named instances then they will start using dynamic ports which is decided at the time of start-up of Windows service corresponding to named SQL Server instance. SQL Server 的默认实例使用端口 # 1433。当您安装命名实例时,它们将开始使用动态端口,这是在启动与命名 SQL Server 实例相对应的 Windows 服务时决定的。

My code was failing (with error code 40) to connect to the only named SQL Server instance that I had on my VM.我的代码无法(错误代码 40)连接到我的 VM 上唯一命名的 SQL Server 实例。 You can try below possible solutions:您可以尝试以下可能的解决方案:

Solution # 1 : Client code trying to connect to SQL Server instance takes help from SQL Server browser service to figure out port number at which your named instance is listening for incoming connections.解决方案 # 1 :尝试连接到 SQL Server 实例的客户端代码需要 SQL Server 浏览器服务的帮助,以确定命名实例正在侦听传入连接的端口号。 Make sure SQL browser service is running on your computer.确保 SQL 浏览器服务正在您的计算机上运行。

Solution # 2 : Check the port # (in yellow color) your named SQL Server instance is using from SQL Server configuration manager as shown in the snapshot below:解决方案 #2 :从 SQL Server 配置管理器检查您的命名 SQL Server 实例正在使用的端口 #(黄色),如下面的快照所示:

在此处输入图片说明

Use that port number explicitly in your connection string or with sqlcmd shown below:在您的连接字符串或下面显示的sqlcmd中明确使用该端口号:

sqlcmd -s mymachinename,11380 -i deleteDB.sql -o SQLDelete.txt

Solution # 3 : Force your named instance to use port # 1433 which is used by default instance.解决方案#3 :强制您的命名实例使用默认实例使用的端口#1433。 Remember this will work only if you don't have any default SQL Server instance on your computer as the default SQL Server instance would be using using port # 1433 already.请记住,这仅在您的计算机上没有任何默认 SQL Server 实例时才有效,因为默认 SQL Server 实例将使用端口 # 1433。 Same port number can't be uses by two different Windows services.两个不同的 Windows 服务不能使用相同的端口号。

Mark TCP Dynamic ports field to blank and TCP Port field to 1433.TCP Dynamic ports字段标记为空白,将TCP Port字段标记为 1433。

在此处输入图片说明

Change the port number in your connection string as shown below:更改连接字符串中的端口号,如下所示:

sqlcmd -s mymachinename\instanceName -i deleteDB.sql -o SQLDelete.txt

OR或者

sqlcmd -s mymachinename,1433 -i deleteDB.sql -o SQLDelete.txt

Note : Every change in TCP/IP settings requires corresponding Windows service restart.注意:TCP/IP 设置的每次更改都需要重新启动相应的 Windows 服务。

Interestingly enough after resolving the error when I went back to dynamic port setting to reproduce the same error then it didn't happen.有趣的是,当我回到动态端口设置以重现相同的错误时解决了错误后,它并没有发生。 Not sure why.不知道为什么。

Please read below interesting threads to know more about dynamic ports of SQL Server:请阅读以下有趣的主题以了解有关 SQL Server 动态端口的更多信息:

How to configure SQL Server Port on multiple instances?如何在多个实例上配置 SQL Server 端口?

When is a Dynamic Port “dynamic”?什么时候动态端口是“动态的”?

When to use a TCP dynamic port and when TCP Port?何时使用 TCP 动态端口,何时使用 TCP 端口?

I got leads to solution of my problem from this blog.我从这个博客中得到了解决我的问题的线索。

in my case, i had a standalone server, i changed the sql server port default port 1433 in configuration manager to some number and restarted the sql serve service to take effect,i was able to connect to the sql server through management studio if i login to the server.就我而言,我有一个独立的服务器,我将配置管理器中的 sql server 端口默认端口 1433 更改为某个数字并重新启动 sql server 服务以生效,如果我登录,我可以通过管理工作室连接到 sql server到服务器。 but i was not able to connect from my local machine through sql server, i was getting the error:但我无法通过 sql server 从我的本地机器连接,我收到错误:

A network-related or instance-specific error occurred while establishing a connection to SQL Server.与 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. SQL Server 配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5) (提供程序:命名管道提供程序,错误:40 - 无法打开与 SQL Server 的连接)(Microsoft SQL Server,错误:5)

I checked and verified all the below我检查并验证了以下所有内容

-Named pipes/TCP is enabled. - 命名管道/TCP 已启用。 -Remote connections are allowed. - 允许远程连接。 -Windows Firewall is off -Created an exception for portin Windows Firewall( this was not necessary in my case as the server is in same subnet network). -Windows 防火墙已关闭 - 为 Windows 防火墙的端口创建了一个例外(在我的情况下这不是必需的,因为服务器位于同一子网中)。 -Enabled everything in SQL Server Configuration Manager. - 启用 SQL Server 配置管理器中的所有内容。

then i chnaged back the port number to default 1433 and restarted the sql server service, and the issue got resolved and i am able to connect the sql server from my local management studio.然后我将端口号改回默认值 1433 并重新启动 sql server 服务,问题得到解决,我可以从本地管理工作室连接 sql server。

I had the same problem.我有同样的问题。 I use the MSSQL Server Management Studio 2017 and solved this problem using these steps:我使用 MSSQL Server Management Studio 2017 并使用以下步骤解决了这个问题:

  1. Check for working fine SQL Server Services services or not.检查工作正常的 SQL Server 服务服务与否。
  2. Also check for working in good condition SQL Server (MSSQLSERVER).还要检查 SQL Server (MSSQLSERVER) 是否运行良好。
  3. Also check for working fine SQL Server Browser.还要检查工作正常的 SQL Server 浏览器。
  4. Restart SQL Server (MSSQLSERVER)重新启动 SQL Server (MSSQLSERVER)

and fixed it.并修复它。

You will find most likely your DB name is not correct, you will see the server name in VS like "DESKTOP-0I14BKI" but if you open up SSMS you will see DESKTOP-0I14BKI\\SQLBLAHBLAH , simply add " \\SQLBLAHBLAH " (instance name) to your "server name" in VS connection properties.您很可能会发现您的数据库名称不正确,您会在 VS 中看到服务器名称,例如“DESKTOP-0I14BKI”,但是如果您打开 SSMS,您将看到DESKTOP-0I14BKI\\SQLBLAHBLAH ,只需添加“ \\SQLBLAHBLAH ”(实例名称) ) 到 VS 连接属性中的“服务器名称”。

You will see :你会看到 在此处输入图片说明

To Fix:修理: 在此处输入图片说明

Very simple solution非常简单的解决方案

use (local)\\InstanceName that's it.使用(local)\\InstanceName就是这样。 it worked for me.它对我有用。

Try the following steps:尝试以下步骤:

  1. Open Services window (open "run box" and type services.msc).打开服务窗口(打开“运行框”并输入 services.msc)。

  2. Looking for SQL services (with SQL prefix).寻找 SQL 服务(带有 SQL 前缀)。

  3. Start them (if cannot start. Goto step 4).启动它们(如果无法启动。转到第 4 步)。

  4. Right_click to each service -> Properties -> Change to tab "Log on"-> choise log on as "Local ..." -> 0K.右键单击每个服务-> 属性-> 更改为选项卡“登录”-> 选择登录为“本地...”-> 0K。 Then start SQL services again.然后再次启动 SQL 服务。

Try Open SQL and connect database.尝试打开 SQL 并连接数据库。

In my case, I opened SQL Server Management Studio and searched for SQLEXPRESS in my Database engine.就我而言,我打开了 SQL Server Management Studio 并在我的数据库引擎中搜索了 SQLEXPRESS。 It had two instances and I selected the correct one.它有两个实例,我选择了正确的一个。

在此处输入图片说明

If you are working with Asp.net core and using appsettings.json than write server as localhost and after write sql instance name for enabled named pipe like this如果您正在使用 Asp.net 核心并使用 appsettings.json 而不是将服务器写入本地主机,然后为启用的命名管道写入 sql 实例名称,如下所示

  "ConnectionString": {
    "dewDB": "server=localhost\\dewelopersql;database=dewdb;User ID=sa;password=XXXXX",
  },

If you tried restarting the MSSQLSERVER service, and it did not work, this might be a solution:如果您尝试重新启动 MSSQLSERVER 服务,但它不起作用,这可能是一个解决方案:

If you are using SQLExpress, your server name should be as the following ComputerName\\SQLExpress.如果您使用 SQLExpress,您的服务器名称应为以下 ComputerName\\SQLExpress。 However, for SQLDeveloper, you do not have to right SQLDeveloper after your ComputerName.但是,对于 SQLDeveloper,您不必在您的 ComputerName 之后正确使用 SQLDeveloper。

After following all the steps mentioned here , if it still does not connect, try adding the DNS with the IP address in the hosts file in the etc folder.按照这里提到的所有步骤操作后,如果仍然无法连接,请尝试在 etc 文件夹中的主机文件中添加具有 IP 地址的 DNS。 Adding an IP address instead of DNS name in the connection string should be a temporary solution to check if the connection actually works.在连接字符串中添加 IP 地址而不是 DNS 名称应该是检查连接是否实际工作的临时解决方案。

I tried using the local IP address to connect as well as a public one.我尝试使用本地 IP 地址和公共 IP 地址进行连接。 I've tried:我试过了:

Yes, the site can communicate with the server Named pipes/TCP is enabled.是的,该站点可以与服务器通信 命名管道/TCP 已启用。 Remote connections are allowed.允许远程连接。 Windows Firewall is off Created an exception for port 1433 in Windows Firewall. Windows 防火墙已关闭 在 Windows 防火墙中为端口 1433 创建了一个例外。 Enabled everything in SQL Server Configuration Manager.启用 SQL Server 配置管理器中的所有内容。

i ensured and did the above as well and I just want to share that the DOUBLE BACKSLASH我确保并执行了上述操作,我只想分享双反斜杠

oBuilder.DataSource = "SPECIFICPCNAME\\SQLEXPRESS"; oBuilder.DataSource = "SPECIFICPCNAME\\SQLEXPRESS";

Using a SINGLE BACKSLASH resulted into a build error ie: Error 1 Unrecognized escape sequence使用单个反斜杠导致构建错误,即:错误 1 ​​无法识别的转义序列

I hope this helps the next guy - I've sacrificed dinner, midnight snack and NBA highlights time solving this (shame)我希望这能帮助下一个人——我已经牺牲了晚餐、宵夜和 NBA 集锦时间来解决这个问题(耻辱)

Thanks to [Tamizh venthan] ^_^感谢 [Tamizh venthan] ^_^

Enable TCP/Ip , Piped Protocol by going to Computer Management ->SQL and Services, ensure the Service is On.通过转到“计算机管理”->“SQL 和服务”启用 TCP/Ip、管道协议,确保服务已打开。 Enbale the port on the Firewall.启用防火墙上的端口。 Try to login through Command Prompt -> as Admin;尝试通过命令提示符登录 -> 以管理员身份登录; last the User Name should be (local)\\SQLEXPRESS.最后用户名应该是(本地)\\SQLEXPRESS。 Hope this helps.希望这可以帮助。

Open SQL Server Configuration Manager打开 SQL Server 配置管理器

  1. Select SQL Server Services from right.从右侧选择 SQL Server 服务。
  2. Find your server from right and go to its properties (with right click)从右侧找到您的服务器并转到其属性(右键单击)
  3. Change log on method to Local System.将登录方法更改为本地系统。

在此处输入图片说明

在此处输入图片说明

I had the same problem and solved the problem by disabling my firewall(ESET).我遇到了同样的问题并通过禁用我的防火墙(ESET)解决了这个问题。

The first step to solve this problem should be to try pinging your own computer from another computer.解决此问题的第一步应该是尝试从另一台计算机 ping 您自己的计算机。 If you have firewall on, you may not be able to ping yourself.如果您打开了防火墙,您可能无法 ping 自己。 I tried pinging my own pc, then ping was failed(didnt get response from the server)我尝试 ping 我自己的电脑,然后 ping 失败(没有得到服务器的响应)

I have suggested below steps to resolve your issue How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server '我建议了以下步骤来解决您的问题如何修复错误“命名管道提供程序,错误 40 - 无法打开与“SQL Server的连接

  1. Check for working fine SQL Server Services services or not.检查工作正常的SQL Server 服务服务与否。
  2. Also check for working in good condition SQL Server (MSSQLSERVER) .还要检查SQL Server (MSSQLSERVER)是否正常工作。
  3. Also check for working fine SQL Server Browser .还要检查SQL Server Browser是否工作正常。
  4. Delete all earlier Aliases , now create new aliases as per your requirements.删除所有以前的别名,现在根据您的要求创建新别名。
  5. Now check for working of SQL Server Default Port 1433现在检查 SQL Server 默认端口 1433 的工作情况
  6. Next click on Client Protocols in instance, then click on TCP/IP , now click on mouse right click, open the Property, here you can make assure your working fine your default port SQL 1433 .接下来单击 Client Protocols 实例,然后单击TCP/IP ,现在单击鼠标右键单击,打开属性,在这里您可以确保您的默认端口SQL 1433正常工作。
  7. Open your SQL Server Management Studio , then right click, click on " Property " option and then click on Connections tab, then finally tick for Allow remote Connections to this server .打开您的SQL Server Management Studio ,然后右键单击,单击“属性”选项,然后单击“连接”选项卡,最后勾选“允许远程连接到此服务器”
  8. Check for right working or your Ping IP Host .检查正常工作或您的Ping IP 主机

I was trying to add a new connection in VS2015.我试图在 VS2015 中添加一个新连接。 None of the suggestions here worked.这里的建议都没有奏效。 Suspecting some sort of a bug in the wizard, especially since SSMS was able to connect just fine, I decided to try and trick it.怀疑向导中存在某种错误,特别是因为 SSMS 能够正常连接,我决定尝试欺骗它。 It worked!有效!

  1. Instead of adding the connection, use "Create new SQL Server Database".不要添加连接,而是使用“创建新的 SQL Server 数据库”。 Enter your server name and a random name for the new DB, eg "test".输入您的服务器名称和新数据库的随机名称,例如“test”。

  2. Assuming this succeeds, open Server Explorer in VS, locate the connection in Data Connections, right-click it and select Modify Connection.假设成功,在VS中打开Server Explorer,在Data Connections中找到连接,右击选择Modify Connection。

  3. Change "test" (from step 1) to the name of the existing database you want to connect to.将“test”(从第 1 步开始)更改为要连接的现有数据库的名称。 Click "Test Connection".单击“测试连接”。 This time it should work!这次应该可以了!

  4. Delete the temporary database you created in step 1.删除您在步骤 1 中创建的临时数据库。

I have one more solution, I think.我想我还有一个解决方案。 I recently had changed my computer name so, after I couldn't connect still after trying all above methods.我最近更改了我的计算机名称,因此在尝试上述所有方法后仍然无法连接之后。 I changed the Server name.. Server name => (browse for more) => under database engine, a new server was found same as computers new name.我更改了服务器名称.. 服务器名称 => (浏览更多) => 在数据库引擎下,发现一个新服务器与计算机新名称相同。 This worked, and life is good again.这奏效了,生活又好了。

在我意识到我的错误之前,我在这个问题上挣扎了很长时间 - 我在连接字符串中使用了逗号而不是分号

I had this issue but none of the suggestions above fixed it.我有这个问题,但上面的建议都没有解决它。

I was seeing this issue when I deployed my website to IIS.当我将我的网站部署到 IIS 时,我看到了这个问题。 The fix was to go into advanced settings against the default app pool and change the identity property from the default to Administrator.修复方法是针对默认应用程序池进入高级设置,并将身份属性从默认值更改为管理员。

For me it was a Firewall issue.对我来说,这是一个防火墙问题。

First you have to add the port (such as 1444 and maybe 1434) but also首先,您必须添加端口(例如 1444 和 1434)而且

C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe

and

%ProgramFiles%\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Binn\SQLAGENT.EXE

The second time I got this issue is when I came back to the firewall, the paths were not correct and I needed to update form 12 to 13!我第二次遇到这个问题是当我回到防火墙时,路径不正确,我需要将表格 12 更新到 13! Simply clicking on browse in the Programs and Services tab helped to realise this.只需单击“程序和服务”选项卡中的浏览即可帮助实现这一点。

Finally, try running the command最后,尝试运行命令

EXEC xp_readerrorlog 0,1,"could not register the Service Principal Name",Null EXEC xp_readerrorlog 0,1,"无法注册服务主体名称",Null

For me, it returned the error reason对我来说,它返回了错误原因

I tried pretty much everything on this page but I had some underlying issues which were actually what needed to be resolved.我几乎尝试了此页面上的所有内容,但我有一些潜在的问题,实际上需要解决这些问题。 I was unable to do certain things like open SQL Server Configuration Manager, which ended up being corrupt/missing WMI provider files.我无法执行某些操作,例如打开 SQL Server 配置管理器,最终导致 WMI 提供程序文件损坏/丢失。

There are lots of tedious ways to resolve this issues according to what I've read, but the tool from tweaking.com was able to remove and replace/repair my WMI (Windows Management Instrumentation) Provider files.根据我所读到的内容,有很多乏味的方法可以解决此问题,但是来自 Tweaking.com 的工具能够删除和替换/修复我的 WMI(Windows 管理规范)提供程序文件。

I used to do computer repair and overall the tweaking.com tool really impressed me, and it was suggested from one of the WMI error forum pages I went to.我曾经做过电脑维修,总的来说,tweaking.com 工具给我留下了深刻的印象,它是从我访问的 WMI 错误论坛页面之一中推荐的。

After I fixed this issue I was able to connect to my SQL db, both locally and remotely.解决此问题后,我能够在本地和远程连接到我的 SQL 数据库。

Hope this helps someone.希望这可以帮助某人。

在您的服务器上打开端口号 1433 以进行 sql 远程连接

I was getting this error on linked server which has gone offline.我在已脱机的链接服务器上收到此错误 It was inside of a sql query, which was inside a dll, which was in another project, and in another language (VB).它位于 sql 查询中,该查询位于 dll 中,该查询位于另一个项目中,并且使用另一种语言 (VB)。 Copy your query into sql studio manager and run directly from there to see if this is your problem as well.将您的查询复制到 sql 工作室管理器并直接从那里运行以查看这是否也是您的问题。

I had a different version of this issue when trying to connect Power BI desktop to a local developer instance of SQL Server 2019. I was using:在尝试将 Power BI 桌面连接到 SQL Server 2019 的本地开发人员实例时,我遇到了这个问题的不同版本。我使用的是:

localhost:<port>

Changing it to:将其更改为:

hostname\servername

solved it for me.为我解决了。 Possibly complicated by the fact I have 2 SQL Server installations on my machine on different ports.由于我在不同端口的机器上安装了 2 个 SQL 服务器,这可能会使情况变得复杂。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 命名管道提供程序,错误:40 - 无法打开与SQL Server的连接? - Named Pipes Provider, error: 40 - Could not open a connection to SQL Server? 仅客户端计算机中的错误“提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接” - Error in Client machine only “provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server” 提供程序:命名管道提供程序,错误:40 - 无法打开与 SQL Server 的连接 - provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server provider:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接。 - provider: Named Pipes Provider, error: 40 – could not open a connection to SQL server. 找不到网络路径。 提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接 - The network path was not found. provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server (提供者:命名管道提供程序,错误:40-无法打开与SQL Server的连接) - (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 例外:命名管道提供者。 错误40-无法打开与SQL Server的连接 - Exception: Named pipes provider. Error 40-Could not open a connection to SQL Server 间歇性错误,Microsoft SQL Server Native Client 11.0:命名管道提供程序:无法打开与SQL Server的连接[5] - intermittent ERROR, Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [5] 如何修复“命名管道提供程序:无法打开与 SQL 服务器 [53] 的连接”? - How to fix 'Named Pipes Provider: Could not open a connection to SQL Server [53]'? IIS 8 SQL Server提供程序:命名管道提供程序,错误:40 - IIS 8 sql server provider: Named Pipes Provider, error: 40
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM