0

I am finding some problem trying to connect to a SQL Server instance from an Ubuntu machine using sqlcmd. The SQL server instance run on another server that is an always on MS-SQL Server cluster.

So I installed sqlcmd as explained here: https://learn.microsoft.com/it-it/sql/linux/sql-server-linux-setup-tools?view=sql-server-ver15#ubuntu

The SQL server seems to be reachable because I can successfully connect to the 1433 port of its IP via Telnet.

Then I tried to connect to one of my database on this server, in this way:

./sqlcmd -S MY-IP-ADDRESS -d ESB_WSO2_USER_DB -U datacenter\\wso2DBAdmin

Where:

  • ESB_WSO2_USER_DB is the DB name
  • datacenter\wso2DBAdmin is the domain\username

It ask me the password, I insert the password (pretty sure that the credential should be ok) but I am obtaining this error message:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed for user 'datacenter\wso2DBAdmin'..

Assuming that username and password are correct: what could be the problem? Is it something that could be related to my sqlcmd installation (maybe some missconfiguration), or the driver? or something related to my connection string? or something related to the SQL Server database?

6
  • datacenter\\wso2DBAdmin isn't a valid SQL Authentication login. So that's why. Commented Dec 4, 2019 at 18:23
  • @Larnu I also tried without domain (only wso2DBAdmin) but I have always the same problem. There is another way to specify domain? Commented Dec 4, 2019 at 18:25
  • 2
    From Linux? Not unless you configure Kerboros on it. That is a long and lengthy (and difficult) task. The -U is for specifying a SQL Authentication login; but I told you this in the answer I gave you earlier. Commented Dec 4, 2019 at 18:27
  • 1
    "In theory can I connect without domain" it's not theory, it's called SQL Authentication; completely different to AD authentication. "I have to connect a java application to this SQL Server...I will have the same issue?" not if you use SQL Authentication. Commented Dec 4, 2019 at 18:34
  • 2
    Authentication in SQL Server Commented Dec 4, 2019 at 18:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.