简体   繁体   English

无法连接 Excel 2016 到 Azure SQL 数据库,即使 SSMS 连接没有问题

[英]Unable to connect Excel 2016 to Azure SQL Database even though SSMS connects without issue

I have an Azure SQL Server (native, not inside a VM) that I connect to every day via SSMS on my local machine - Windows 10 Pro.我有一个 Azure SQL 服务器(本机,不在 VM 内),我每天通过本地计算机上的 SSMS 连接到该服务器 - Windows 10 Pro。

For the first time, I am trying to connect Excel 2016 via Data-> Get Data-> From Database -> From SQL Server Database.我第一次尝试通过数据-> 获取数据-> 从数据库-> 从 SQL 服务器数据库连接 Excel 2016。

From there I am asked for the Server name, followed by login credentials, which I use the exact username and password I'm using for SSMS.从那里我被要求输入服务器名称,然后是登录凭据,我使用我用于 SSMS 的确切用户名和密码。 I get an error message that says We couldn't authenticate with the credentials provided. Please try again.我收到一条错误消息,提示We couldn't authenticate with the credentials provided. Please try again. We couldn't authenticate with the credentials provided. Please try again.

This doesn't make any sense to me.这对我来说没有任何意义。 My SSMS work perfectly, and Excel is under the same IP address as SSMS which is whitelisted.我的 SSMS 运行良好,并且 Excel 与被列入白名单的 SSMS 位于相同的 IP 地址下。 Is there something else inside Excel's settings which I'm missing? Excel 的设置中是否还有我遗漏的其他内容?

FYI, I tried the server name both with and without 1433 after it just to be sure.仅供参考,为了确定,我尝试了带有和不带有 1433 的服务器名称。 Same result.结果相同。

Screenshots below.截图如下。

#1

#2

I tried using the data, get data, sql server option. 我尝试使用数据,获取数据,sql server选项。 It does not understand azure sql database. 它不了解azure sql数据库。

If I use the data, new query, azure sql database option, I have the same screens that you have. 如果我使用数据,新查询,azure sql数据库选项,我有你所拥有的相同屏幕。 I am using Excel 2016. 我正在使用Excel 2016。

Here is your issue! 这是你的问题!

There are two tabs on the second screen. 第二个屏幕上有两个选项卡。 You are filling in the window tab. 您正在填写窗口选项卡。 Therefore, it is trying to log into the database with windows (active directory) authentication. 因此,它尝试使用Windows(活动目录)身份验证登录数据库。 Choose the second option on the left pane, database. 在左窗格中选择数据库的第二个选项。 Use database credentials. 使用数据库凭据。

This should work with no issues. 这应该没有问题。

I tested it out on my local machine. 我在我的本地机器上测试了它。

for azure sql you always need to provide the database name, as you do not have rights to list databases on azure.对于 azure sql,您始终需要提供数据库名称,因为您无权在 azure 上列出数据库。 (so this optional is not that optional for azure:) (所以这个可选对于 azure 来说不是可选的:)

I could list tables on azure sql from office 2016 on mac, nevertheless the excel query app shows only the tables but does not show any views.我可以在 mac 上的 office 2016 中列出 azure sql 上的表格,但是 excel 查询应用程序仅显示表格,但不显示任何视图。 Once i made a table the import was hanging while trying to get the data.一旦我制作了一张表格,导入在尝试获取数据时就会挂起。 making a smaller table (just 60K rows) did not help.制作一个较小的表(只有 60K 行)并没有帮助。 The SQL server connectivity seems to be broken/very slow on mac excel 2016. SQL 服务器连接似乎在 mac excel 2016 上被破坏/非常慢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM