在SQL Server中新建了SQL Server authentication用户却连不上

发布时间 2023-07-29 19:03:30作者: PowerCoder

在SQL Server中新建了一个SQL Server authentication用户Super,也设置了密码:

但是使用SQL Server authentication连接的时候,用户Super怎么也连不上:

折腾了半天,原来发现是SQL Server服务器的SQL Server Authentication mode没有开启,在SSMS中选中SQL Server服务器,右键点击Properties菜单:

然后选择左侧的Security菜单,并且设置Server authentication为SQL Server and Windows Authentication mode

注意,最后记得要重启SQL Server服务后,更改的配置才会生效:

之后就可以用我们新建的SQL Server用户Super成功登录了:

本来SQL Server and Windows Authentication mode这个设置应该是在安装SQL Server的时候就可以选好的,但是应该是在安装SQL Server时没有注意到这个选项,选掉了,所以导致SQL Server authentication用户连不上SQL Server。