用户“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
login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008
提问by Rev
I use windows 7 ultimate. I can login with windows authentication mode but SQL authentication with user sa
doesn't work. sa
user 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 Properties
from the context menu > Select Security
node 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)
回答by Ateev Gupta
Click on Start menu > Programs > Microsoft Sql Server > Configuration Tools
Select Sql Server Surface Area Configuration.
Now click on Surface Area configuration for services and connections
On the left pane of pop up window click on Remote Connections and Select Local and Remote connections radio button.
Select Using both TCP/IP and named pipes radio button.
click on apply and ok.
单击开始菜单 > 程序 > Microsoft Sql Server > 配置工具
选择 Sql Server Surface Area 配置。
现在单击服务和连接的表面积配置
在弹出窗口的左侧窗格中,单击远程连接并选择本地和远程连接单选按钮。
选择同时使用 TCP/IP 和命名管道单选按钮。
单击应用并确定。
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) 要修复此错误,请执行以下步骤
connect to sql server using window authentication.
Now right click on your server name at the top in left pane and select properties.
Click on security and select sql server and windows authentication mode radio button.
Click on OK.
restart sql server servive by right clicking on server name and select restart.
使用窗口身份验证连接到 sql server。
现在右键单击左窗格顶部的服务器名称并选择属性。
单击安全并选择 sql server 和 windows 身份验证模式单选按钮。
单击确定。
通过右键单击服务器名称并选择重新启动来重新启动 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
- First make sure
sa
is enabled - Change the authontication mode to mixed mode (Window and SQL authentication)
- Stop your SQL Server
- Restart your SQL Server
- 首先确保
sa
已启用 - 将身份验证模式更改为混合模式(Window 和 SQL 身份验证)
- 停止您的 SQL Server
- 重新启动 SQL Server
回答by Sibeesh Venu
Login with windows authentication mode and fist of all make sure that the sa
authentication 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.
右键单击服务器,然后单击“属性”。
Now go to the Security section and select the option SQL Server and Windows Authentication mode
现在转到安全部分并选择选项 SQL Server and Windows Authentication mode
Once that is done, click OK. And then enable the sa
login.
完成后,单击“确定”。然后启用sa
登录。
Go to your server, click on Security and then Logins, right click on sa
and then click on Properties.
转到您的服务器,单击“安全”,然后单击“登录”,右键单击sa
然后单击“属性”。
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 sa
user.
现在我们可以重新启动 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 sa
user using SQL Server Management Studio (SSMS). I was facing this error even when security settings for sa
user 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 Pipes
protocol was disabled. Here is how you can enable it:
最后,问题是该Named Pipes
协议被禁用。以下是启用它的方法:
Open SQL Server Configuration Manager application from start menu. Now, enable Named Pipes
protocol for both Client Protocols
and Protocols for <SQL Server Instance Name>
nodes as shown in the snapshot below:
从开始菜单打开 SQL Server 配置管理器应用程序。现在,Named Pipes
为Client Protocols
和Protocols for <SQL Server Instance Name>
节点启用协议,如下面的快照所示:
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 Pipes
enabling 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
- Go to services.msc from run prompt.
- Restart the services of SQL server(MSSQLSERVER)
- Restart the services of SQL server(SQLEXPRESS)
- 从运行提示转到 services.msc。
- 重启SQL服务器服务(MSSQLSERVER)
- 重启SQL服务器服务(SQLEXPRESS)