sqlcmd:用户"NT AUTHORITY \ ANONYMOUS LOGON"的登录失败 [英] sqlcmd: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

查看:113
本文介绍了sqlcmd:用户"NT AUTHORITY \ ANONYMOUS LOGON"的登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有特权连接到test2上的数据库,但是如果我使用相同的帐户在另一台主机上远程桌面,并在那里运行以下命令

I have the privilege to connect to db on test2, but if I remote desktop on another host using the same account, and run the following command there

SQLCMD -E -S test2 -d测试-i Silo.sql -b -v

SQLCMD -E -S test2 -d test -i Silo.sql -b -v

(受影响的1行) 消息18456,级别14,状态1,服务器test \ colo,第1行
用户'NT登录失败 AUTHORITY \ ANONYMOUS LOGON'.

(1 rows affected) Msg 18456, Level 14, State 1, Server test\colo, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

为什么会这样,解决方法是什么?

Why this happen, and what's the workaround?

奇怪的是,它抱怨用户为"NT AUTHORITY \ ANONYMOUS LOGON",但实际上,我使用了自己的帐户

And strangely, it complains the user is 'NT AUTHORITY\ANONYMOUS LOGON', but in reality, I used my own account

推荐答案

如果您提出要求,则会收到此错误

You will get this error if you have asked for

  1. 连接到远程服务器
  2. 本地服务器在域中
  3. 远程服务器不在域中

将不会使用您的域登录名建立连接(目标上未知),而是使用匿名登录

The connection will not be made using your domain login (which is unknown on the target, but will instead use ANONYMOUS)

  • 看着你的错误

(受影响的1行)消息18456,级别14,状态1, Server test\colo ,行1用户"NT AUTHORITY \ ANONYMOUS"的登录失败 登录".

(1 rows affected) Msg 18456, Level 14, State 1, Server test\colo, Line 1 Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

相反,脚本的一部分似乎正在从 test test \ colo 访问链接的服务器对象,并且您没有正确设置链接的服务器登录名.如果 test test \ colo 不在同一个域中,那么您将需要使用

It looks instead like part of your script is accessing linked server object from test through to test\colo, and you have not set up linked server logins correctly. If test and test\colo are not on the same domain, then you will need to set up linked server login mapping using sp_addlinkedsrvlogin

这篇关于sqlcmd:用户"NT AUTHORITY \ ANONYMOUS LOGON"的登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆