SQL Server 2019安装后出现连接失败
Posted Jennifer_糖糖
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL Server 2019安装后出现连接失败相关的知识,希望对你有一定的参考价值。
解决SQL Server 连接失败的问题
最近因学习数据库系统原理,下载安装了一个2019版本的,启动服务后,发现使用Aqua Data Studio根本连不上,打开设备管理器 一看1433端口没有监听;
于是在网站上搜索解决方案,基本上都是说在 SQLServer的管理配置界面设置一下,TCP/IP的端口即可。也的确如此;但是我配置完端口之后,依旧无法正常连接。
因为我遇到的情况相对特殊一些,我的计算机上安装了虚拟机,虚拟了很多的网卡以及IP,所以需要设置所有IP的port并enabled,然后重启服务即可:
一般解决方法:
1、打开配置管理器,检查微软SQL服务器(MSSQLServer)的TCP/IP协议是否开启。
确保上面设置正确后,进行最后的SQL服务器防火墙设置,(问题大多出在这里)
1、可以直接关闭防火墙,但是这样不安全,不建议采用。
2、找到微软SQL服务器(MSSQLServer)的TCP/IP协议。在SQL服务器防火墙已经处于运行状态下,点击“TCP/IP协议”选择属性
从上图中我们可以看出,这台SQL服务器上支持TCP/IP协议的是1433端口。下一步要做的是在防火墙的配置中允许1433端口支持TCP/IP协议即可。打开“控制面板”选择“Windows防火墙”——“高级设置”。右击“入站规则(Inboud Rules)”选项,选择“新建规则(NewRule)”:
打开“新建规则”选项后,利用“新建入站规则向导”为1433端口配置“内部绑定协议”配置为适用于TCP/IP协议即可。
配置过程:
点击下一步
下一步
点击完成
完成上述步骤后,SQL服务器即可支持远程链接了。赶紧试试吧!
???Sql Server???SQL SERVER ????????????
?????????int with ?????? serve span ?????? inner -- blog
??????:???Sql Server???SQL SERVER ??????????????????SQL SERVER 2005?????????????????????????????????????????????SQL SERVER 2005???????????????CTE?????????????????????CTE?????????????????????
??????CTE??????????????????Common Table Expression ???SQL SERVER 2005????????????????????????????????????
#??????????????????
1???sql
1 Create table GroupInfo([Id] int,[GroupName] nvarchar(50),[ParentGroupId] int) 2 3 Insert GroupInfo 4 5 select 0,??????????????????,null union all 6 7 select 1,??????????????????,0 union all 8 select 2,??????????????????,1 union all 9 select 3,??????????????????,1 union all 10 select 4,????????????????????????,2 union all 11 select 5,????????????????????????,2 union all 12 select 6,????????????????????????,3 union all 13 select 7,????????????????????????,3 union all 14 15 select 8, ???????????????,0 union all 16 select 9, ?????????????????????,8 union all 17 select 10,????????????????????????,8 union all 18 select 11,???????????????????????????,9 union all 19 select 12,???????????????????????????,9 union all 20 select 13,??????????????????????????????,10 union all 21 select 14,??????????????????????????????,10
2????????????
#????????????Demo
1???????????????????????????????????????????????????,???????????????????????????
1 --???????????????????????????????????????????????? 2 with 3 CTE 4 as 5 ( 6 select * from GroupInfo where Id=1 7 union all 8 select G.* from CTE inner join GroupInfo as G 9 on CTE.Id=G.ParentGroupId 10 ) 11 select * from CTE order by Id
1 --???????????????????????????????????????????????? 2 with 3 CTE 4 as 5 ( 6 select * from GroupInfo where Id=14 7 union all 8 select G.* from CTE inner join GroupInfo as G 9 on CTE.ParentGroupId=G.Id 10 ) 11 select * from CTE order by Id
2?????????????????????
1 --?????????????????? 2 with 3 CTE 4 as 5 ( 6 select Id,GroupName,ParentGroupId,GroupPath=CAST( GroupName as nvarchar(max)) from GroupInfo where Id=1 7 union all 8 select G.*,CAST(CTE.GroupPath+???//???+G.GroupName as nvarchar(max)) as GroupPath from CTE 9 inner join GroupInfo as G 10 on CTE.Id=G.ParentGroupId 11 ) 12 select * from CTE
3?????????????????????????????????????????????????????????
1 --??????id????????????????????????????????????sort??????????????????sort?????????????????????????????????????????????????????? 2 WITH 3 CTE 4 AS 5 ( 6 SELECT * ,CAST(RIGHT(???000??? + CAST([Id] AS VARCHAR), 3) AS VARCHAR(MAX)) AS sort FROM GroupInfo 7 WHERE ParentGroupId = 0 8 UNION ALL 9 SELECT GroupInfo.* ,CAST(sort + RIGHT(???000??? + CAST(GroupInfo.[Id] AS VARCHAR),3) AS VARCHAR(MAX)) AS sort 10 FROM CTE 11 INNER JOIN GroupInfo ON CTE.Id = GroupInfo.ParentGroupId 12 ) 13 SELECT * FROM CTE ORDER BY sort
4?????????????????????????????????????????????????????????
1 --?????????????????? 2 WITH CTE AS ( 3 SELECT *,1 AS [Level] FROM GroupInfo WHERE ParentGroupId=0 4 UNION ALL 5 SELECT G.*,CTE.Level+1 FROM GroupInfo as G 6 JOIN CTE ON CTE.Id =G.ParentGroupId 7 ) 8 SELECT * FROM CTE
以上是关于SQL Server 2019安装后出现连接失败的主要内容,如果未能解决你的问题,请参考以下文章
用户登录失败,该用户与可信SQL Server连接无关联,错误:18452
win10,sql server 2019 安装失败, 数据库引擎服务安装失败?