用户“sa”登录失败。用户未与受信任的 SQL Server 连接相关联。(Microsoft SQL Server,错误:18452)在 sql 2008 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3583605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 07:21:09  来源:igfitidea点击:

login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008

sqlsql-serversql-server-2008

提问by Rev

I use windows 7 ultimate. I can login with windows authentication mode but SQL authentication with user sadoesn't work. sauser is enabled. So what do I do?

我使用的是 Windows 7 Ultimate。我可以使用 Windows 身份验证模式登录,但用户的 SQL 身份验证sa不起作用。sa用户已启用。那我该怎么办?

回答by Kashif

Go to Start> Programs> Microsoft SQL Server> Enterprise Manager

前往Start> Programs> Microsoft SQL Server>Enterprise Manager

Right-click the SQL Server instance name > Select Propertiesfrom the context menu > Select Securitynode in left navigation bar

右键单击 SQL Server 实例名称 >Properties从上下文菜单中选择 >Security在左侧导航栏中选择节点

Under Authentication section, select SQL Server and Windows Authentication

在身份验证部分下,选择 SQL Server and Windows Authentication

Note: The server must be stopped and re-started before this will take effect

注意:服务器必须停止并重新启动才能生效

Error 18452 (not associated with a trusted sql server connection)

错误 18452(与受信任的 sql server 连接无关)

回答by Ateev Gupta

  1. Click on Start menu > Programs > Microsoft Sql Server > Configuration Tools

  2. Select Sql Server Surface Area Configuration.

  3. Now click on Surface Area configuration for services and connections

  4. On the left pane of pop up window click on Remote Connections and Select Local and Remote connections radio button.

  5. Select Using both TCP/IP and named pipes radio button.

  6. click on apply and ok.

  1. 单击开始菜单 > 程序 > Microsoft Sql Server > 配置工具

  2. 选择 Sql Server Surface Area 配置。

  3. 现在单击服务和连接的表面积配置

  4. 在弹出窗口的左侧窗格中,单击远程连接并选择本地和远程连接单选按钮。

  5. 选择同时使用 TCP/IP 和命名管道单选按钮。

  6. 单击应用并确定。

Now when try to connect to sql server using sql username and password u'll get the error mentioned below

现在,当尝试使用 sql 用户名和密码连接到 sql server 时,您将收到下面提到的错误

Cannot connect to SQLEXPRESS.

无法连接到 SQLEXPRESS。

ADDITIONAL INFORMATION:

附加信息:

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) ation To fix this error follow steps mentioned below

用户“用户名”登录失败。用户未与受信任的 SQL Server 连接相关联。(Microsoft SQL Server,错误:18452) 要修复此错误,请执行以下步骤

  1. connect to sql server using window authentication.

  2. Now right click on your server name at the top in left pane and select properties.

  3. Click on security and select sql server and windows authentication mode radio button.

  4. Click on OK.

  5. restart sql server servive by right clicking on server name and select restart.

  1. 使用窗口身份验证连接到 sql server。

  2. 现在右键单击左窗格顶部的服务器名称并选择属性。

  3. 单击安全并选择 sql server 和 windows 身份验证模式单选按钮。

  4. 单击确定。

  5. 通过右键单击服务器名称并选择重新启动来重新启动 sql server servive。

Now your problem should be fixed and u'll be able to connect using sql server username and password.

现在您的问题应该得到解决,您将能够使用 sql server 用户名和密码进行连接。

Have fun. Ateev Gupta

玩得开心。阿捷夫·古普塔

回答by user2713396

  1. First make sure sais enabled
  2. Change the authontication mode to mixed mode (Window and SQL authentication)
  3. Stop your SQL Server
  4. Restart your SQL Server
  1. 首先确保sa已启用
  2. 将身份验证模式更改为混合模式(Window 和 SQL 身份验证)
  3. 停止您的 SQL Server
  4. 重新启动 SQL Server

回答by Sibeesh Venu

Login with windows authentication mode and fist of all make sure that the saauthentication is enabled in the server, I am using SQL Server Management Studio, so I will show you how to do this there.

使用 Windows 身份验证模式登录,首先确保sa在服务器中启用了身份验证,我正在使用SQL Server Management Studio,因此我将在那里向您展示如何执行此操作。

Right click on the server and click on Properties.

右键单击服务器,然后单击“属性”。

enter image description here

在此处输入图片说明

Now go to the Security section and select the option SQL Server and Windows Authentication mode

现在转到安全部分并选择选项 SQL Server and Windows Authentication mode

enter image description here

在此处输入图片说明

Once that is done, click OK. And then enable the salogin.

完成后,单击“确定”。然后启用sa登录。

Go to your server, click on Security and then Logins, right click on saand then click on Properties.

转到您的服务器,单击“安全”,然后单击“登录”,右键单击sa然后单击“属性”。

enter image description here

在此处输入图片说明

Now go tot Status and then select Enabled under Login. Then, click OK.

现在转到状态,然后在登录下选择启用。然后,单击确定。

Now we can restart the SQLExpress, or the SQL you are using. Go to Services and Select the SQL Server and then click on Restart. Now open the SQL Server Management Studio and you should be able to login as sauser.

现在我们可以重新启动 SQLExpress 或您正在使用的 SQL。转到服务并选择 SQL Server,然后单击重新启动。现在打开 SQL Server Management Studio,您应该能够以sa用户身份登录。

回答by RBT

I faced the very same error when I was trying to connect to my SQL Server 2014 instance using sauser using SQL Server Management Studio (SSMS). I was facing this error even when security settings for sauser was all good and SQL authentication mode was enabled on the SQL Server instance.

当我尝试sa使用 SQL Server Management Studio (SSMS) 的用户连接到我的 SQL Server 2014 实例时,我遇到了同样的错误。即使sa用户的安全设置都很好并且在 SQL Server 实例上启用了 SQL 身份验证模式,我也遇到了这个错误。

Finally, the issue turned out to be that Named Pipesprotocol was disabled. Here is how you can enable it:

最后,问题是该Named Pipes协议被禁用。以下是启用它的方法:

Open SQL Server Configuration Manager application from start menu. Now, enable Named Pipesprotocol for both Client Protocolsand Protocols for <SQL Server Instance Name>nodes as shown in the snapshot below:

从开始菜单打开 SQL Server 配置管理器应用程序。现在,Named PipesClient ProtocolsProtocols for <SQL Server Instance Name>节点启用协议,如下面的快照所示:

enter image description here

在此处输入图片说明

Note: Make sure you restart the SQL Server instance after making changes.

注意:确保在进行更改后重新启动 SQL Server 实例。

P.S.I'm not very sure but there is a possibility that the Named Pipesenabling was required under only one of the two nodes that I've advised. So you can try it one after the other to reach to a more precise solution.

PS我不太确定,但有可能Named Pipes仅在我建议的两个节点之一下需要启用。因此,您可以一个接一个地尝试,以获得更精确的解决方案。

回答by siva

  1. Go to services.msc from run prompt.
  2. Restart the services of SQL server(MSSQLSERVER)
  3. Restart the services of SQL server(SQLEXPRESS)
  1. 从运行提示转到 services.msc。
  2. 重启SQL服务器服务(MSSQLSERVER)
  3. 重启SQL服务器服务(SQLEXPRESS)