无法以只读用户身份登录到SQL Azure数据库 [英] Cannot login with read-only user to SQL Azure database

查看:36
本文介绍了无法以只读用户身份登录到SQL Azure数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经回答了以下问题:

I've followed the answer to this question: In SQL Azure how what script can I use to create a read only user

我已经在正确的服务器上成功完成了所有步骤.但是,当我尝试登录到Azure数据库时,出现以下错误:

I've completed all the steps successfully on the correct server. However, when I try to login to the Azure database, I'm getting the following error:

Login failed for user 'readerUser'.
This session has been assigned a tracing ID of '(some guid)'.
Provide this tracing ID to customer support when you need assistance.

我在ASP.NET网站和LINQPad中都尝试过,它们都给出相同的错误(使用不同的GUID).我正在尝试连接到与我的主要登录名完全相同的服务器,该服务器可以完美连接.

I've tried this in both my ASP.NET website and in my LINQPad, they both give the same error (with different GUIDs). I am trying to connect to the exact same server as my primary login, which can connect perfectly.

我还检查了 sys.sysusers 系统视图,并在其中登录了 readerUser .

I've also checked sys.sysusers system view and readerUser is there as a login.

可能是什么原因?

推荐答案

尝试了多种组合(并更好地了解了SQL Azure上的用户,登录名和角色之后),我发现了问题所在:

After trying many combinations (and learning better about users, logins, and roles on SQL Azure) I've figured out the issue:

我试图使用只是数据库用户的 readerUser 登录,而我应该使用登录实例登录,因此是 reader (后跟我已链接的问题的答案).我曾尝试使用 reader 登录,但效果很好:登录后, SELECT 可以输入我想要的任何内容,但无法写/更改/删除任何内容.

I was trying to login with readerUser, which is just a database user, and I should instead have logged in with the login instance, hence reader (as followed by the answer at the question that I've linked). I've tried logging in with reader and it worked perfectly: logging in, SELECTing anything I want, but not able to write/alter/delete anything.

这篇关于无法以只读用户身份登录到SQL Azure数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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