How to Connect with Dbeaver on Snowflake (DUO Push) - snowflake-cloud-data-platform

I am using Duo Mobile for authentication in snowflake . I have entered username and password and warehouse details in Dbeaver. But I keep getting error
"DUO PUSH IS NOT ENABLED FOR YOUR MFA. PROVIDE A PASSCODE AS PART OF THE CONNECTION STRING" .
I have tried to see
https://community.snowflake.com/s/article/error-duo-push-is-not-enabled-for-your-mfa-provide-a-passcode-as-part-of-the-connection-string
here it says to add "passcodeInPassword=on".
Where do I need to add this?

I don't think we need to enable this parameter specifically for DUO to send the push notification. I tested this on DBeaver Community Version 21.2.2.202110030714 with a Snowflake user that is enabled for DUO and the connection (Test and Connect) works fine with the notification being received on the configured device.

You can right-click the Snowflake connection and hit 'Edit Connection' and then go to the 'Driver Properties' tab. Then, add the 'passcode' as a 'User Property' and put the actual passcode in the 'Value' field. Worked for me.

DBeaver might be using the JDBC driver to create a connection to Snowflake.
You may need to pass it in the JDBC connection string at client (DBeaver) end.
See- https://docs.snowflake.com/en/user-guide/security-mfa.html#using-mfa-with-jdbc

Related

MSSQL connection String:

I'm trying to create scaledobject in keda and I'm referring the official keda documentation for this with MSSQL scaler.
While configuring connectionstring in this format "Server=example.database.windows.net;Port=1433;Database=AdventureWorks;Persist Security Info=False;User ID=user1;Password=Password#1;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" , Is the server to be configured is same as hostname?
Basically, whether the host parameter that we specify in connection parameters explicitly is the same as the Server parameter in ADO format: ?
Can someone please help me here? After deploying my scaled object in keda with MSSQL trigger(I'm considering server name is same as host instance and configured like that) , I'm getting ready and active status as unknown.. In logs I'm only seeing that it's trying to create a HPA and then nothing happens. I guess the operator is getting stuck here. Please guide me on how to proceed to establish connection with MSSQL
As per the docs you either have to specify the connection string OR host: keda.sh/docs/latest/scalers/mssql

What should the connection string be when using Azure Sql Failover groups?

Ok so I have set up a Azure Sql Failover group at mydatabase.databsae.windows.net which contains 2 servers:
mydatabase1.databsae.windows.net
mydatabase2.databsae.windows.net
I go to connectionstrings.com to get my Sql Azure Connection String which looks like so:
Server=tcp:mydatabase.database.windows.net;Database=mySqlDatabase;
User ID=MyUser#[serverName];Password=myPassword;Trusted_Connection=False;
Encrypt=True;
Now the problem lies in User ID=MyUser#[serverName] I have tried:
User ID=MyUser#mydatabase but that didn't work and repeatedly returns the error:
Database 'mySqlDatabase' on server 'mydatabase' is not currently
available. Please retry the connection later
I also tried User ID=MyUser#mydatabase1 and that did work.
But the problem with the above in the connection string is that when I do failover to mydatabase2 I will need to go and update all my connection strings.
So what is the correct connection string when using Sql Failover groups?
This is a current limitation of failover groups:
Note: If at this point you go to SSMS and try to connect to your
Primary/Secondary database using above listeners, you will receive
error and will not be able to login. Ideally it should have allowed,
but it currently fails, as it tries to connect to the Master database
which is currently not part of the group. This is currently being
worked upon and should be resolved soon. Till then, workaround is to
provide the database name while connecting to server. Use the option
button to provide database name.
what this means is that currently only the following connection strings will work:
Server=tcp:mydatabase.database.windows.net;Database=mySqlDatabase;
User ID=MyUser#mydatabase1;Password=myPassword;Trusted_Connection=False;
Encrypt=True;
OR
Server=tcp:mydatabase.database.windows.net;Database=mySqlDatabase;
User ID=MyUser#mydatabase2;Password=myPassword;Trusted_Connection=False;
Encrypt=True;
Unfortunately this renders the automatic failover completely useless as you need to then reconfigure all your connection strings
Ref: https://social.technet.microsoft.com/wiki/contents/articles/37968.working-with-azure-sql-auto-failover-group.aspx
Try :
Server=tcp:mydatabase.database.windows.net;Database=mySqlDatabase;
User ID=MyUser#mydatabase;Password=myPassword;Trusted_Connection=False;
Encrypt=True;MultiSubnetFailover=True;

Setup Azure MSSQL Database in Ejabberd server?

I'm developing chat application, I'm using ejabberd for my project. I installed ejabberd server(16.06) successfully and it performing good in auth method as internal. But it is not working when I'm changed auth method as sql. These are the things I'm changed in ejabberd.yml file
default_db: sql
auth_method: sql
## ODBC compatible or MSSQL server:
##
sql_type: mssql
sql_server: "Server=azure_server_name;DSN=DB_Name;UID=azure_DB_username;PWD=azure_DB_password"
sql_pool_size: 10
sql_keepalive_interval: 28800
mod_mam:
iqdisc: one_queue
db_type: sql
default: always
I'm getting following error for while I'm register new user and admin login into web admin portal
ejabberd_auth:is_user_exists:316 The authentication module ejabberd_auth_sql returned an error
when checking user <<"newuser">> in server <<"localhost">>
Error message: {timeout,{p1_fsm,sync_send_event,[<0.390.0>,{sql_cmd,{sql_query,{sql_query,<<"Q9525209">>,#Fun<sql_queries.9.38301790>,#Fun<sql_queries.10.38301790>,#Fun<sql_queries.11.38301790>,{sql_queries,145}}},3534866},60000]}}
I'm used register command:
bin>ejabberdctl register "newuser" "localhost" "password"
Thanks in advance. Please add your ideas and suggestions to resolve this issue.
Again- I am no Ejabberd expert- I imagine someone might have more experience with this; However, it seems that you're confusing Register which I assume is an action to create a login on the Ejabberd platform with the login that is being used on the database. (Or I'm misinterpreting your comments. One of the two.)
You will need to use a username/password combination that exists on the Azure SQL Database in your connection string.
Additionally, you might try the following connection string :
sql_server:"Server=tcp:azure_server_name.database.windows.net;DSN=DB_Name;UID=azure_DB_username;PWD=azure_DB_password"

Login failed for user 'sa' while trying to create datasource with Railo

So I'm trying to setup Railo and I want to add a datasource.
For the database I'm using Microsoft SQL server Management Studio.
But now I've run into the classical problem: "Login failed for user 'sa'. ClientConnectionId:afd80ac2-0744-4a7d-a9f7-083d93adee0d"
What I've done so far:
With the SQL Server Configuration Manager in the TCP/IP settings I enabled the IPs I had to.
I set the password for the user 'sa' in MSSQL and I added a user mapping for the table I want to use.
I made the user 'sa' the owner of the DB i want to connect to
Restarted the SQL service, my computer and Railo multiple times.
I'm pretty much out of ideas.
After Leigh mentioned in the comments to look at my logs it had the following message: "Login failed for user 'max'. Reason: Failed to open the explicitly specified database 'test'. [CLIENT: 127.0.0.1]"
I then tried to make a connection without mentioning a database and that worked.
I would also point to Leigh's answer here which explains how to turn Mixed-Mode authentication on, as this can also cause this error. Since the cause of this isn't on Railo/Lucee's end, this issue still arises in 2018.
I just don't want a useful answer to get lost to history, nor plagiarize an answer I barely found.

Connect to a heroku database with pgadmin

I would like to manage my Heroku database with pgadmin client. By now, I've been doing this with psql.
When I use data from heroku pg:credentials to connect de DB using pgadmin, I obtain:
An error has occurred:
Error connecting to the server: FATAL: permission denied for database
"postgres" DETAIL: User does not have CONNECT privilege.
How to achieve the connection?
Open the "Properties" of the Heroku server in pgAdminIII and change the "Maintenance DB" value to be the name of the database you want to connect to.
The default setup is suitable for DBAs et al who can connect to any database on the server, but apparently that isn't true in your case.
After you change the Maintenance DB name as suggested by araqnid's answer above, you should also add your database to the DB restrictions field because without this you will see thousands of databases and you may not be able to find yours in the list if the list is too long.
More details here - How to hide databases that I am not allowed to access
This is for pgAdmin 4
In order to connect pgAdmin to your database (postgres instance in Heroku), do the following:
Login to Heroku, and select the application in which you have the database
Select the Resources tab and then click on "Heroku Postgres Ad-on" (see below). This will open up a new tab.
Select the Settings tab and then click on "View Credentials..." (see below)
You will get the following information that you will use in pgAdmin:
Go to pgAdmin, and create a new server
In the General tab, give a useful name
In the Connection tab, fill the info you got at Heroku
In order to avoid seeing thousands of databases, you need to add your database name to DB restriction in the Advanced tab (see below)
We require SSL for connections outside Heroku. Please verify whether you're forcing SSL in your client.
Answered more thoroughly here: Connecting pgAdmin3 to Postgres on Heroku
We don't allow connections to the postgres database, so be sure to set Maintenance DB to your database name, and be sure to use SSL.
Change the Maintenance Database to the name of your Database, e.g. dva70000p0090. This should work.
the db password local isnt the same db password heroku. please check the heroku ip postgtres address and extrac

Resources