SQL Server2019无法通过IP登录和连接数据库
使用基本类型安装了SQL Server2019数据库,并安装SSMS(SQL Server Management Studio)管理数据库。
在数据库所在的服务器上连接和登录数据库没有问题,但是在其他服务器上连接数据库会报错:
Exception:
System.InvalidOperationException: The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): 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)
---> System.ComponentModel.Win32Exception (5): 拒绝访问。
原因是通过基本类型方式安装后,SQL Server的TCP/IP协议没有启用。解决方法是:
打开SQL Server Configuration Manager,在SQL Server网络配置中启用TCP/IP协议。
找不到SQL Server Configuration Manager的话可以从开始菜单的Microsoft SQL Server 2019目录下找SQL Server 2019配置管理器。
启用TCP/IP协议,如下图所示:
启用后,重启SQL Server2019服务后,就可以通过IP登录和连接数据库了。
更新于:3个月前相关文章
- IP、域名查询
- 使用 navicat 连接数据库
- PHP获取客户端真实IP地址
- .NET C# EntityFrameworkCore(EF)连接PostgreSQL数据库
- .NET C#连接使用PostgreSQL数据库
- 现在开发使用Sql语句还是ORM更多?
- Linux中如何释放DHCP获取的IP地址并重新获取
- Symfony/Doctrine中的SQL注入
- 在 Windows Server Server/Windows 11 上安装 VirtIO 驱动程序
- SQL生成框架Vanna.ai用法教程
- .NET自然语言转换为SQL的Nl2Sql项目
- 解决Python并发爬虫中的IP封禁问题
- 解决PHP开发中的SQL注入攻击问题
- SQL语句优化
- Java调用IP代理接口实现软件IP转换
- C/C++语言中socket IP地址的结构体
- Windows中C语言如何获取本机的所有IP地址
- Sql Server清空表并重置主键序号
- sql创建并循环临时表
- Sql语句行转列