gpt4 book ai didi

sql-server - 尝试运行 sqlcmd 失败,无法建立连接?

转载 作者:行者123 更新时间:2023-12-02 14:30:09 24 4
gpt4 key购买 nike

当我尝试运行 sqlcmd(从 cmd 提示符)时,出现以下错误:

HResult 0x2, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in stance-specific error has occurred while establishing a connection to SQL Server . Server is not found or not accessible. Check if instance name is correct and i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.

不知道为什么会发生这种情况?我可以从我的 asp.net 网站(在本地运行,如数据库)连接到 sql 服务器,但 sqlcmd 无法连接。

最佳答案

如果您没有使用默认实例,请尝试以下命令:

sqlcmd -S MACHINENAME\INSTANCE_NAME

注意大写的 S。还要注意,我没有给它用户密码,因为默认的 sqlcmd 身份验证是 windows auth,所以我可以以当前用户身份登录。
有关 Microsoft 的更多信息,请查看 > http://msdn.microsoft.com/en-us/library/ms165702.aspx

关于sql-server - 尝试运行 sqlcmd 失败,无法建立连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4012526/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com