C:\Users\qjj>sqlcmd -S 127.0.0.1,1433
Msg 18452, Level 14, State 1, Server QJJ-PC, Line 1
Login failed. The login is from an untrusted domain and cannot be used with Wind
ows authentication.
C:\Users\qjj>sqlcmd -S 127.0.0.1 -U sa -P pl,okm123
Msg 18456, Level 14, State 1, Server QJJ-PC, Line 1
Login failed for user 'sa'.
[/Quote]
从错误信息上看是登陆帐户问题。如果可以,将 SQL Server 错误日志中登陆失败的信息提供一下。
或者,自己判断一下
ERROR STATE ERROR DESCRIPTION
2 and 5 Invalid userid
6 Attempt to use a Windows login name with SQL Authentication
7 Login disabled and password mismatch
8 Password mismatch
9 Invalid password
11 and 12 Valid login but server access failure
13 SQL Server service paused
18 Change password required
有什么错误提示?
SQL Server 错误日志(Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG)中有没有 Server is listening on [ 'any' <ipv4> 1433]. 类似的信息?
用 sa 帐户登陆
sqlcmd -S 127.0.0.1 -U sa -Ppassword
用命名管道登陆
sqlcmd -S np:127.0.0.1
[/Quote]
C:\Users\qjj>sqlcmd -S 127.0.0.1,1433
Msg 18452, Level 14, State 1, Server QJJ-PC, Line 1
Login failed. The login is from an untrusted domain and cannot be used with Wind
ows authentication.
C:\Users\qjj>sqlcmd -S 127.0.0.1 -U sa -P pl,okm123
Msg 18456, Level 14, State 1, Server QJJ-PC, Line 1
Login failed for user 'sa'.
C:\Users\qjj>sqlcmd -S np:127.0.0.1
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Unable to complete logi
n process due to delay in opening server connection.