简体   繁体   English

在 Ubuntu Linux 上使用 LDAP 连接到 MSSQL 服务器

[英]Connecting to a MSSQL server using LDAP on Ubuntu Linux

I'm trying to connect to a MS SQL Server, using a linux client.我正在尝试使用 Linux 客户端连接到 MS SQL Server。 I've tried both SQuirreL and DBeaver, but having no luck in either case.我已经尝试过 SQuirreL 和 DBeaver,但在任何一种情况下都没有运气。 I've tried a few different drivers.我尝试了几个不同的驱动程序。

The connection string I am given looks something like this:我得到的连接字符串看起来像这样:

jdbc:oracle:thin:@ldap://<server>:<port>/<database>,cn=OracleContext,dc=<specific_dc>,dc=<specifc_dc>,dc=<specific_dc> jdbc:oracle:thin:@ldap://<server>:<port>/<database>,cn=OracleContext,dc=<specific_dc>,dc=<specifc_dc>,dc=<specific_dc>

This seems to be an invalid URL, and I've tried various combinations of things (like using jdbc:sqlserver:// ... protocol, etc. It doesn't seem to like the @ldap in the connection string, and I've replaced the commas with semicolons. But, I'm new to connecting to SQL Server, much less using LDAP.这似乎是一个无效的 URL,我尝试了各种组合(例如使用 jdbc:sqlserver:// ... 协议等。它似乎不喜欢连接字符串中的 @ldap,我已经用分号替换了逗号。但是,我是连接到 SQL Server 的新手,更不用说使用 LDAP。

Any thoughts/help?任何想法/帮助?

Thanks!谢谢!

For those who are using DBeaver the way to connect to the SQL Server Database with an AD user is using the jTDS driver.对于那些使用 DBeaver 的用户,通过 AD 用户连接到 SQL Server 数据库的方式是使用 jTDS 驱动程序。 I am using DBeaver 6.0 in Debian 9. The user is an AD user.我在 Debian 9 中使用 DBeaver 6.0。用户是 AD 用户。

In order to connect to the SQL Server from Linux Debian using DBeaver为了使用 DBeaver 从 Linux Debian 连接到 SQL Server

1.- Select SQL Server jTDS driver 1.- 选择 SQL Server jTDS 驱动程序

在此处输入图片说明

2.- Enter the connection information 2.- 输入连接信息

在此处输入图片说明

3.- Go to Driver Properties tab and add the domain, user, password 3.- 转到驱动程序属性选项卡并添加域、用户、密码在此处输入图片说明

在此处输入图片说明

Just as a note, in some post I found that they needed to change the property USENTLMV2 to TRUE but it worked for me either by putting the USERTLNMV2 in true or false.作为说明,在一些帖子中,我发现他们需要将属性 USENTLMV2 更改为 TRUE,但通过将 USERTLNMV2 设置为 true 或 false 对我有用。

A problem that I found was that when I was trying to connect to the database using my user and password the next error was thrown:我发现的一个问题是,当我尝试使用我的用户名和密码连接到数据库时,抛出了下一个错误:

登录失败。登录名来自不受信任的域,不能与 Windows 身份验证一起使用。

This error was thrown because of my user was about to expire.由于我的用户即将到期,因此抛出此错误。 I tried with another AD user and it could connect.我尝试了另一个 AD 用户,它可以连接。

cts: datasource: url: jdbc:jtds:sqlserver://dbserver:1433;database=DB;domain=yourdomain.com;useNTLMv2=true driver-class-name: net.sourceforge.jtds.jdbc.Driver username: username password: password hikari: connection-test-query: SELECT 1 maximumPoolSize: 2 minimumIdle: 1

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

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