如何使用 Windows 身份验证远程连接到 SQL Server 数据库? [英] How to connect to SQL Server database using windows authentication remotely?

查看:164
本文介绍了如何使用 Windows 身份验证远程连接到 SQL Server 数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的问题,我被授予在本地计算机上使用 Windows 身份验证的 SQL Server 数据库,我还需要知道如何在托管服务器上使用此访问权限.

I have a simple question, I was granted to a SQL Server database using windows authentication on my local machine, I need to know how to use this access on hosting server as well.

例如,我正在编写一些从这个数据库中提取数据的 C# 代码,我可以在我的本地机器上运行这个代码,我的 Windows 身份验证没有问题,但我无法在预期的托管服务器上运行它,因为该服务器显然无法连接到该数据库.

For example I am in the middle of writing some C# code that pulls data from this database, I can run this code on my local machine with my windows authentication no problem, but I can't run it on expected hosting server because that server obviously can't connect to that database.

我只是想知道如何远程使用 Windows 身份验证访问?

I was just wondering how can I use windows authentication access remotely?

谢谢

推荐答案

必须在远程服务器上启用 Windows 身份验证才能执行此操作.这可以在服务器属性 > 安全性中启用,并通过选择 SQL Sever 和 Windows 身份验证单选按钮来启用.提供您的 Windows 凭据添加到服务器,然后您应该能够登录.

Windows authentication must be enabled on the remote server to do this. This can be enabled in server properties > Security and by selecting SQL Sever and Windows Aucthentication radio button. Providing your windows credentials are added to the server then you should be able to login.

在您的 SSMS 上,右键单击数据库名称选择属性,然后从左侧菜单中选择安全性,您应该会看到SQL Sever 和 Windows 身份验证"选项.

On your SSMS right click the database name select properties and select Security from the left hand menu and there you should see the "SQL Sever and Windows Aucthentication" option.

显然,如果您的数据库不在同一个域中,那么这可能不起作用.

Obviously if your database is not on the same domain then this might not work.

这篇关于如何使用 Windows 身份验证远程连接到 SQL Server 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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