[英]User does not have permission to access a database
I'm trying to connect to a database using Windows Authentication. 我正在尝试使用Windows身份验证连接到数据库。 I believe that my current user does not have access to it.
我相信我当前的用户无法访问它。
How can I enable a user to login to SQL Server, and use the database? 如何让用户登录到SQL Server并使用数据库?
You need to use the SQL Server Management Studio program to grant access for the user. 您需要使用SQL Server Management Studio程序为用户授予访问权限。 You'll need to connect in with a login that has administration privileges for the database.
您需要使用具有数据库管理权限的登录名进行连接。 If you have don't have those privileges you'll need to contact someone that does.
如果您没有这些特权,则需要联系有此特权的人。
If you do have a login with those privileges: 如果您确实拥有具有这些权限的登录信息:
DOMAIN\\Username format
. DOMAIN\\Username format
,则用户的名称应与用户的Windows登录名相同。 Permission can also be added by group so you should check for groups that the user belongs to as well. 权限也可以按组添加,因此您应该检查用户所属的组。
I had a scenario where I inherited a PC from another developer that left the organization. 我有一个场景,我从另一个离开组织的开发人员那里继承了一台PC。 I couldn't access the default instance using Windows Authentication.
我无法使用Windows身份验证访问默认实例。
Here was the solution: 这是解决方案:
This will automatically add your Windows Authentication user account (Active Directory or local user) to the SQL Server instance. 这将自动将您的Windows身份验证用户帐户(Active Directory或本地用户)添加到SQL Server实例。 You will now be able to connect right away to the selected instance.
您现在可以立即连接到所选实例。 As best practice, reset the settings back to the Built-in user account (most likely Network Service).
最佳做法是将设置重置为内置用户帐户(最可能是网络服务)。
That's it! 而已!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.