简体   繁体   English

为什么 SSMS 无法连接到本地 SQL Server 实例?

[英]Why is SSMS unable to connect to local SQL Server instance?

I have installed both SQL Server 2019 and SSMS 2018.我已经安装了 SQL Server 2019 和 SSMS 2018。

SQL Server is configured with following parameters: SQL 服务器配置如下参数:

  • Shared memory: enabled共享 memory:启用
  • TCP/IP: enabled TCP/IP:启用
  • Named Pipes: enabled命名管道:启用

When I try to connect from SSMS to the local server, I get the following error:当我尝试从 SSMS 连接到本地服务器时,出现以下错误:

TITLE: Connect to Server标题:连接到服务器

Cannot connect to SQL-SERVER-02.无法连接到 SQL-SERVER-02。

ADDITIONAL INFORMATION:附加信息:

Login failed for user 'SQLSERVER\myusername'.用户“SQLSERVER\myusername”登录失败。 (Microsoft SQL Server, Error: 18456) (微软 SQL 服务器,错误:18456)

Please see the screenshot for illustration.请参阅屏幕截图以获取说明。

Note: my username is the same reported in the image:注意:我的用户名与图片中报告的用户名相同:

在此处输入图像描述

A couple of things to check.有几件事要检查。

  1. Did you add yourself as an administrator on the server (SQL, not the computer)?您是否将自己添加为服务器(SQL,而不是计算机)的管理员? Unlikely, at least with the logged on account, as you are failing login.不太可能,至少使用已登录的帐户,因为您登录失败。 To fix this, you have to add your account.要解决此问题,您必须添加您的帐户。 To do this without logging in, you need to do something like this - This is 2008, but the concept is still sound.要在不登录的情况下执行此操作,您需要执行以下操作 - 这是 2008 年,但这个概念仍然合理。 Google for other options?谷歌还有其他选择吗?
  2. Do you have mixed mode enabled?是否启用了混合模式? If so, you can log in with the sa account and password.如果是这样,您可以使用 sa 帐户和密码登录。 And, once in, you can add your account to the admin group like this而且,一旦进入,您可以像这样将您的帐户添加到管理员组

@Larnu has also answered with the Microsoft page. @Larnu 也回答了 Microsoft 页面。 It is a bit harder to read, but has the same advice as the first link in mine.它有点难以阅读,但与我的第一个链接有相同的建议。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM