Error Connecting to SQL Sever ->Setting AD ID user for connecting to SQL server using mqsisetdbparams for broker running on linux - sql

I have a requirement of configuring the broker with AD id and password to connect to SQL database server .
The commands what I entered for setting up is given below :
First I created DSN
stopped the broker
executed :
mqsisetdbparams BROKERNAME -n SQL_ASDA_TMS -u UK\\sqltmsdb -p wmbdev
started the broker
After setting the above property and restarting the broker I tried to validate the connectivity using mqsicvp command which eventually failed and the error was logged in SQL Server as
login failed for user 'UK\sqltmsdb' .Reason:Attempting to use an NT account name with SQL server authentication .
Find my DSN details below :
;# UNIX to SQLServer stanza
[SQL_ASDA_TMS]
Driver=/opt/IBM/mqsi/7.0/ODBC/V6.0/lib/UKmsss24.so
Description=DataDirect 6.0 SQL Server Wire Protocol
Address=LABUKNTS5028.uk.wal-mart.com,14481
AnsiNPW=Yes
Database=TMS
Trusted_Connection=Yes
QuotedId=No
ColumnSizeAsCharacter=1
LoginTimeout=0
Note:
Broker is running on linux .
The windows application is able to connect to SQL server using that AD Id
Broker is able to connect to the same SQL server using normal SQL id and password and failing with AD (active directory) Id
Can somebody help me in telling whether whatever I am trying to implement is possible or not ?
If yes could you please help me what should I be doing to resolve this issue and if I am missing something here ?

Windows authentication for your DB means, you don't need a user id and password to connect to the database if you are logged in to the windows machine with the corresponding user id.
"User id" in mqsisetdbparams is treated as a database user id and password and hence giving your Active directory's user id and password in the command will be wrong.
So, in short, an ODBC connection will not be possible from the broker to your database using windows authentication.
But, you always have the option of using the JDBC connection. This should work even with windows authentication as it doesn't mandate you to give user id and password.
You can use the JDBC connection via a java compute node in your message flow(reference).
Here you can find how to use windows authentication for a JDBC connection.

Related

Why application in Azure Container Instance cannot connect to Azure SQL DB for PostgreSQL?

I have Python application in Azure Container Instance, which tries establish connection to Azure DB for PostgreSQL, but failing. Azure DB firewall is open for Azure services. Connection works fine, when application is connecting from local machine docker.
I wonder what is the problem?
psql: error: FATAL: password authentication failed for user "myuser"
'sales.Customers' table is unavailable - sleeping
* Could not resolve host: hslotp
* Closing connection 0
OTP is unavailable - sleeping
Have you checked the ports match, here is something you can verify from Troubleshoot connection issues to Azure Database for PostgreSQL
make sure you have the latest of psycopg2 release or atleast above 2.8.0
Also, the connection string should looks like below. Make sure you get Server name and login details from Azure portal.
postgresql://user:password#container_name:5432?sslmode=disable
Refer: thon to connect and query data in Azure Database for PostgreSQL

Create API acceess to SQL Server Express 2014

I have kind of simple issue but fail to resolve it.
Here's the issue: I have SQL Server Express 2014 installed on my PC. I have to use SQL Server authentication because it should work when network is down. As sa I created login and user e.g. user1. Then as user1 I created DB e.g. db1 and a few tables. Now I could login into db1 as user1 using SQL Server authentication. The problem is that this db1 will be used by application e.g. app1. This app1 has configuration file that has all credentials and other connection strings things. Well when I start that application it throws error "Can't connect to database". Then I look into log and see this: Error: 18456, Severity: 14, State: 8. Login failed for user 'user1'. Reason: Password did not match that for the login provided [CLIENT: .
Then I could disable credential check in configuration file of app1 and then I don't have problem to start app1 but I have to use credential check.
Then I tried to created ODBC connection and use the same credentials and I succeed to connect.
Could some give the idea what could be wrong and I can't connect to db1 from my app1?
Thanks
All set, Thanks for info. I installed client 2008 R2 and now it's working. The problem was with the type of authentication. In my case it was equal 'true' and expected exact SQL user password which I was not able to pass because it was encrypted. When I change the type to 'false' it started to use Windows authentication and that resolved my problem.
Ticket could be closed

Windows Service not connecting to SQL Anywhere DB

I had built an application to connect to MySQL DB and SyBase - SQL Anywhere DB using VB.NET and appropriate ODBC connections. This was working fine until we had to make this application a service which keeps running in the background irrespective of any users logged in.
I built the application into a service and after installation, the service was able to successfully connect to MySQL DB, but I am getting the following error when connecting to SyBase (please note the connection string is exactly same as used in the application)
ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Database server not found
The project installer - service process installer 1 is configured as localsystem.
The creepiest thing here is, mysql connection is successful, when the same application was not a service, connecting to sybase was successful. Once it was made into a service it started failing. I have a Windows 7 64-bit workstation and VS 2010.
I have been trying to do every single thing for the last one week to fix it but nothing seems to be working. Any advice would be highly appreciated.
Looks like you are using a DSN to connect to SQL Anywhere.
First, make sure that you have configured it as a System DSN. Then, verify that you are using a TCP/IP connection protocol (ODBC Admin -> Select System DSN tab -> Select DSN in list -> Click Configure -> Goto Network tab) and NOT Shared Memory.
Using Shared Memory will NOT work from a Win Service that tries to connect to a SQL Anywhere DB Server.
I suspect that is the issue since you are able to connect from a desktop app using the same connection string.
One way to make this work is to start your SQL Anywhere db as a network server (Start -> All Programs -> Sql Anywhere 12 (or 11, depending on your setup) -> SQL Anywhere -> Network Server.
That should run the dbsvr12.exe, which will start listening for connections on a TCP port.
Then, add a Links=tcpip, or a Host=localhost to your Win Service connection string and give that a try!
Take notice that simple win app is running with credentials from logged user, while windows service is running on system account (in your case). You have two options, change connection string to connect with specific user (if you are now using trusted connection) or change windows service logon user to your user.

Connection via ODBC to SQL Server failing

I have a strange issue. I can connect from one Terminal server to the SQL server as an admin. I can also connect to the server via a straight SQL connection as a normal user. When I try and log on to the server using odbc I receive the following error.
07/08/2011 10:49:14,Logon,Unknown,Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: 10.0.0.25]
07/08/2011 10:49:14,Logon,Unknown,Error: 18456 Severity: 14 State: 58.
The SQL server is definitely in mixed mode and a user is definitely set up in the connection. It must be a permissions issue.
Probably the user that tries to login does not have permission to the database he/she is trying to connect.
Go to the SQL Server > Security > Select the User - Right Click > Properties > User Mapping
And there select the database that user needs to access (check box in the map column)
I'm pretty sure that error had happened to me before that that's how I fixed it. Assuming it is true that your server is setup as mixed mode already.
If your using ado.net, make sure your using the ODBC data adapter, connectors and odbcCommands instead of the SQL ones. ;)

MSSQL login authentication problems with ODBC connection and R stats package

I am trying to connect an ODBC source to the R statistical package but having log in problems.
I have set up the ODBC name eplR with an SQL server driver linking to the (local) server using windows NT authentication with the network login ID default. In the set up the data-source test is successful.
When I try and create the connection in R
library(RODBC)
channel <- odbcConnect("eplR")
I get a failed connection
Login failed for user pssguy-PC/pssguy - my local computer name
When I connect to the (local) SQL server 2005 via management studio with Windows authentication I get a similar error unless I open management studio
with the "run as administrator" option.
In management studio, if I look at the properties of the (local) server, the authentication is set to Windows authentication mode.
The permission to connect SQL grantor is sa and the Grant box is checked. There is also a connect sql permission for pssguy-PC\pssguy with an unchecked box. I check it but on restarting mssql server it has reverted to unchecked.
I had what I thought was an identical setup on another standalone machine and I have no problems connecting in R.
Any help much appreciated
Maybe with odbcConnect() you could try passing the uid and pwd arguments too?
i.e.
odbcConnect("eplR", "**USERNAME**", "**PASSWORd**")