简体   繁体   English

Microsoft SQL Server:“登录失败。 该登录名来自不受信任的域,不能与Windows身份验证一起使用。”

[英]Microsoft SQL Server: “Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.”

I tried to connect to Microsoft SQL Server and it gives me the error Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. ClientConnectionId:f5448d0d-950a-45b3-842f-9d2c6ac86ccd 我尝试连接到Microsoft SQL Server,但出现错误“ Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. ClientConnectionId:f5448d0d-950a-45b3-842f-9d2c6ac86ccd Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. ClientConnectionId:f5448d0d-950a-45b3-842f-9d2c6ac86ccd

When I run netstat -na and I found a listening with a port of 1433 but still, the connection with Java doesn't work. 当我运行netstat -na ,我发现侦听端口为1433,但仍然无法与Java建立连接。

My code: 我的代码:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

connnectionUrl = "jdbc:sqlserver://localhost:1434;database=Northwind;integratedSecurity=true;";

con = DriverManager.getConnection(connnectionUrl);

Full stacktrace: 完整的堆栈跟踪:

   com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. ClientConnectionId:f5448d0d-950a-45b3-842f-9d2c6ac86ccd
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
    at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:258)
    at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:104)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4772)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3581)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:81)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3541)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2395)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2042)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1889)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1120)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:700)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at jdbc.Temp.main(Temp.java:18)

您是否遵循了说明

Solved it. 解决了。 it was because my PC name and Windows User was in Hebrew, changed it to English and it worked. 这是因为我的PC名称和Windows用户使用希伯来语,所以将其更改为英语,并且可以正常工作。 also, check in the sql server path there aren't any folders named in Hebrew Thank you, everyone, who helped. 另外,请在sql服务器路径中检查希伯来语中没有命名的任何文件夹。谢谢大家的帮助。 :) :)

暂无
暂无

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

相关问题 登录请求的SQL Server临时登录失败“无法打开数据库” *****”。 登录失败。” - Transient login failures to SQL Server “Cannot open database ”*****“ requested by the login. The login failed.” 使用Windows身份验证从不受信任的域通过Java远程连接到SQL Server - Remotely connect to SQL Server through Java from an untrusted domain with Windows authentication 用户''通过Java的Windows身份验证连接到SQL Server 2005时登录失败 - Login failed for user '' while connecting to SQL Server 2005 through windows authentication from Java 使用域用户 ID 连接到 sql server - SQLServerException:用户登录失败 - Connect to sql server with domain user id - SQLServerException: Login failed for user JDBC SQL Server身份验证错误:用户“”登录失败 - JDBC SQL Server Authentication Error: Login failed for user '' 尝试通过SQL Server身份验证连接到SQL Server 2008 Express数据库始终会导致“用户'...'登录失败。”。 - Trying to connect to SQL Server 2008 Express database with SQL Server authentication always result in “Login failed for user '…'.” Java 连接到 SQL 服务器用户登录失败 - Java connection to a SQL Server Login failed for user 即使我提供SQL Server凭据,ODBC登录也尝试使用Windows身份验证 - ODBC login is trying to use Windows authentication even though I supply SQL Server credentials 使用Java中的SQL身份验证登录 - Login with SQL authentication in Java 通过微软进行 Firebase 身份验证 - 登录选项卡未显示 - Firebase authentication via microsoft - Login tab not showing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM