Setup Azure MSSQL Database in Ejabberd server? - sql-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"

Related

Azure Serverless SQL Serverless Database

I Created SQL Server Database in Azure which is serverless and tried to access it using my SQL Server Management Studio in my local but I couldn't get it work.
It always gives me this message:
I tried to whitelist also my IP in Azure but still I get the same result.
Is there a possible way to make it connect?
Is the database currently online or paused?
I'll repeat the text from #David Browne's link:
If a serverless database is paused, then the first login will resume the database and return an error stating that the database is unavailable with error code 40613. Once the database is resumed, the login must be retried to establish connectivity. Database clients with connection retry logic should not need to be modified.
So;
Assuming the database is paused, this is normal operation
Please read docs
You need to retry after the database starts OR manually pre-start it using the Powershell provided in the link below
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-serverless#connectivity
And yes, you also need to whitelist your IP address as you have already done.
Obviously this flavour of SQL is unsuitable for some types of applications - there is more information in the link - I suggest you read the whole thing.

SQL Developer / SQLPLUS login to Oracle 12c DB using AD credentials through Kerberos

I'm totally new to Oracle and have been tasked with setting up 12c for a class a professor is teaching next semester. He wants the students to be able to use their AD accounts to access the database they'll be working on. I looked at available options, and without extending the AD schema, kerberos looked to be my only option.
I tried following a combination of these:
http://www.ateam-oracle.com/configuring-your-oracle-database-for-kerberos-authentication/
https://docs.oracle.com/database/121/DBSEG/asokerb.htm#DBSEG9646
In terms of the Oracle documentation above, my process is breaking down on step 8. After step 7 (which I performed on a domain controller), when I attempt to login to SQLPLUS with SYSTEM account, I was receiving:
ORA-12641: Authentication service failed to initialize
If I try to connect with the SYSTEM (or Active Directory) account through SQL DEVELOPER I get this:
Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in the connect descriptor
So I added NTS back to SQLNET.AUTHENTICATION_SERVICES, but the problem persists. On top of that, Enterprise Manager Express (https://:5500/em) is also no longer accessible.
This same thing happened the first time I tried stepping through the available documentation, and I managed to get everything back to a default by deleting sqlnet.ora, listerner.ora and starting from scratch... But now I'm back in the same place again.
If it is helpful, here are the contents of sqlnet.ora:
#
SQLNET.KERBEROS5_KEYTAB = c:\Windows\oracle.keytab
SQLNET.AUTHENTICATION_SERVICES = (BEQ, TCPS, KERBEROS5, NTS)
SQLNET.KERBEROS5_CONF = c:\Windows\krb5.ini
SQLNET.AUTHENTICATION_KERBEROS5_SERVICE = oracle
SQLNET.KERBEROS5_CC_NAME=OSMSFT:
ADR_BASE = D:\app\oracle\product\12.1.0\dbhome_1\log
#
I did comment out SQLNET.AUTHENTICATION_SERVICES = (BEQ, TCPS, KERBEROS5, NTS) which I allowed me to login with the built-in accounts again, and brought Enterprise Manager Express back up.
Any guidance on this is greatly appreciated. Thanks!

oracle.dataaccess invalid username/password

I am having a asp.net web application in which I am connecting to a Oracle DB using oracle.DataAccess component. My DBA created a new account and when I try to login with that account in toad, it simply worked fine but when I am passing the values in connection string in SERVER A it is giving me invalid username/password. I double checked the credentials and they are correct. Then I copied the entire website into a new SERVER B and when i tried, I am able to login to the oracle DB. I am very much confused about whats happening. Any Ideas? Is it possible to enable any trace on my servers?
Which version (Oracle DB and Oracle.DataAccess) do you use?
In Oracle 11 passwords are case-sensitive (by default), in prior version it was not. Thus Oracle.DataAccess version earlier than 11 may have problems dealing properly with case sensitive passwords.

VB, I keep getting login failed for user... when I'm trying to connect to sql server database

I cannot connect to my local sql server using the following line
conn = SqlConnection("server=(local);uid=tedpottel;pwd=#######;database=by")
I have security set to Windows Authentication , so my other programs (reporting services and cold fusion do not take in a password. (as long as I log in as tedpottel) So I tried
conn = SqlConnection("server=(local);database=by")
which said "failed for user''"
If you do windows authentication, you don't need userID and password
You need to add ;Trusted_Connection=True, it would look like this
Server=(local);Database=by;Trusted_Connection=True;
see here http://connectionstrings.com/sql-server-2008
Are you sure that you have Mixed Authentication enabled:
and are you sure that you are typing in the password correctly as well?

change some field type cause exception when access the database

I change some field from char(50) to be VARCHAR(MAX).
I did this change from the visual studio.
Now, i trying to access to the database and i get the exception
Cannot open user default database.
Login failed. Login failed for user
'NT AUTHORITY\NETWORK SERVICE'.
my knowledge on sql is very pure - and i dont know how to solve this problem.
I used this - and still nothing work fine.
Thanks for any help.
Update: I reverse the change that i made thru the visual studio - and all work fine.
I made the change in same way and the exception appear again.
Is there some other way to do this simple change ?
Basically because your WCF server app runs under the network service account it cannot use windows authentication to connect to SQL. Can you not use SQL username and password as the connection string?

Resources