Mr Mikkél
Mr Mikkél

Reputation: 2643

Connecting to a MSSQL server using LDAP on Ubuntu Linux

I'm trying to connect to a MS SQL Server, using a linux client. I've tried both SQuirreL and DBeaver, but having no luck in either case. 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>

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.

Any thoughts/help?

Thanks!

Upvotes: 3

Views: 4069

Answers (2)

user14300860
user14300860

Reputation: 1

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

Upvotes: -2

mavi
mavi

Reputation: 1138

For those who are using DBeaver the way to connect to the SQL Server Database with an AD user is using the jTDS driver. I am using DBeaver 6.0 in Debian 9. The user is an AD user.

In order to connect to the SQL Server from Linux Debian using DBeaver

1.- Select SQL Server jTDS driver

enter image description here

2.- Enter the connection information

enter image description here

3.- Go to Driver Properties tab and add the domain, user, password enter image description here

enter image description here

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.

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:

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

This error was thrown because of my user was about to expire. I tried with another AD user and it could connect.

Upvotes: 3

Related Questions