Deleted the DB2 Service Credentials. Created new credentials. New username and password not recognized for connection - db2

#I'm using IBM DB2 on the cloud service (lite) of IBM. I deleted the DB2 Service Credentials but I didn't get to save the original password and username. I deleted that credential and created a new one. But using the ibm_db commands from python notebooks and sql to connect to the database, an error occurs:
SQLCODE=-30082ct: [IBM][CLI Driver] SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001
I've tried repeatedly deleting and creating new service credentials but same error occurs. Not sure if I need the original or something. Is there a way to implement the password change without access to the original?
I use the following python code using a jupyter notebook. I assign the dsn_driver and others as a string e.g. dsn_uid = "abc1234".
import ibm_db
dsn = (
"DRIVER={0};"
"DATABASE={1};"
"HOSTNAME={2};"
"PORT={3};"
"PROTOCOL={4};"
"UID={5};"
"PWD={6};"
"SECURITY={7};").format(dsn_driver, dsn_database, dsn_hostname, dsn_port, dsn_protocol, dsn_uid, dsn_pwd,dsn_security)
try:
conn = ibm_db.connect(dsn, "", "")
print ("Connected to database: ", dsn_database, "as user: ", dsn_uid, "on host: ", dsn_hostname)
except:
print ("Unable to connect: ", ibm_db.conn_errormsg() )
RESULTS:

Related

db2 cloud or ODBC connection to R

Here i tried to setup my database service instance in ibm cloud DB2 and Access service credentials.
library(RODBC)
dsn_driver <- "{IBM DB2 ODBC Driver}"
dsn_database <- "bludb" # e.g. "bludb"
dsn_hostname <- "b1bc1829-6f45-4cd4-bef4-10cf081900bf.c1ogj3sd0tgtu0lqde00.databases.appdomain.cloud" # e.g "54a2f15b-5c0f-46df-8954-.databases.appdomain.cloud"
dsn_port <- "32304" # e.g. "32733"
dsn_protocol <- "TCPIP" # i.e. "TCPIP"
dsn_uid <- "xxxxxxxxx" # e.g. "zjh17769"
dsn_pwd <- "xxxxxxxxxxxxxxxx" # e.g. "zcwd4+8gbq9bm5k4"
dsn_security <- "ssl"
Then i Create a database connection
Create a connection string and connect:
conn_path <- paste("DRIVER=",dsn_driver,
";DATABASE=",dsn_database,
";HOSTNAME=",dsn_hostname,
";PORT=",dsn_port,
";PROTOCOL=",dsn_protocol,
";UID=",dsn_uid,
";PWD=",dsn_pwd,
";SECURITY=",dsn_security,
sep="")
conn <- odbcDriverConnect(conn_path)
but here i got this warning msg that the connection is field:
Warning messages:
1: In odbcDriverConnect(conn_path) :
[RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
2: In odbcDriverConnect(conn_path) : ODBC connection failed
as i took the credentials information from the same cloud server as the below pic:
enter image description here
thank you
Hello i have question , i struggled when i try to connect the database in DB2 cloud to local R server , so i am a beginner and i found the steps for this are very mixed up so i downloaded the data bases to the DB2 cloud then i need to connect these datasets to R to do the sql functions as it requested in my course for IBM,

Cannot connect to my PostgreSQL server remotely from chainlink node terminal

I have tried everyting to connect my Chainlink node up to my postgresql database with no luck. I have scoured the interwebs for answers to no avail...
Here is the error message I am receiving:
[ERROR] failed to initialize database, got error failed to connect to `host=/tmp user=root database=`: dial error (dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory)
Here is my .env file:
ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=42
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*
ETH_URL=wss://kovan.infura.io/ws/v3/id...
DATABASE_URL=https://chainlink-db-url://postgres:Password#chainlink-kovan:5432
I have tried every configuration of the connection string. Also I am able to connect to the db via pgAdmin no problem and the dbs are publicaly accessible.
The postgresql database is on AWS.
Please change the syntax of your DATABASE_URL to:
DATABASE_URL=postgresql://"username":"password"#"public-ip-pg-server":5432/"database-name"
just change:
"username" : you need to configure a new user, because the default/admin user postgres will not work for it.
"password" : password of the user
"public-ip-pg-server" : the public ip address of your postgresql-server
"database-name" : the name of your database
PS: delete all " in your syntax (;
Here is the link to the official documentation: https://docs.chain.link/docs/connecting-to-a-remote-database/

How can I write a query to connect mongodb?

I have installed mongodb in different server. I have modified my old code
db: 'mongodb://localhost/dev',
to new code
my username : proUseAdd
password : mongodb#23
ip : 169.213.64.127
I modified like this
db: 'mongodb://proUseAdd:mongodb#23#169.213.64.127:27017/dav',
I am getting this error
Could not connect to MongoDB!
Error: failed to connect to
[23#169.213.64.127:27017]
UPDATE
i have tried changed my password:mongodb23
query strin:
db: 'mongodb://proUseAdd:mongodb23#169.213.64.127:27017/dav',
still i'm getting error
Could not connect to MongoDB!
Error: failed to connect to
[169.213.64.127:27017]
Change your password to something which doesn't contain #.
While parsing your connection string, MongoDB driver looks for the # character to separate your credentials and the host name. Since your password has an # in it, it recognizes your credentials as proUseAdd:mongodb and your host name as 23#169.213.64.127:27017.

"Internal server error" when migrating Parse to Heroku/AWS

I am evacuating the sinking Parse ship.
Migrated data to MongoDB
Tested connection with MongoDB while using api.parse.com
Hosted Parse server on Heroku \ AWS both
Tested the servers by going to their URL and seeing 'I dream of being web site"
Updated the appid, master key, and mongo uri for AWS and Heroku servers
In my app delegate when I use,
let config = ParseClientConfiguration(block:{ (ParseMutableClientConfiguration) -> Void in
ParseMutableClientConfiguration.applicationId = "APPID"
ParseMutableClientConfiguration.clientKey = "myClientKey"
ParseMutableClientConfiguration.server = "my AWS or Heroku server"
})
Parse.initializeWithConfiguration(config)
And I try to connect to update the MongoDB database, I get the following error,
[Error]: {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)
Code=3840 "JSON text did not start with array or object and option to allow fragments not set."
Any help appreciated, thank you
Solved the issue, it was a silly mistake, the problem was that I had an #symbol in the password and I had not url-encoded it. When I escaped the symbol and restarted the server it started working.

Using SSPI to connect to remote PostgreSQL server using Npgsql

I am using nHibernate + Npgsql to connect to PostgreSQL server using windows authentication (SSPI). I have added the windows user to the Postgres and have configured the settings as recommended by http://wiki.postgresql.org/wiki/Configuring_for_single_sign-on_using_SSPI_on_Windows.
Here is my connection string:
"Server=;Port=5432;Database=;Integrated Security=true"
This is my code:
if (!sessionFactories.TryGetValue(sessionFactoryConfigPath, out sessionFactory))
{
Configuration cfg = new Configuration();
if (sessionFactoryConfigPath != DefaultConfigFile)
{
//Check.Require(File.Exists(sessionFactoryConfigPath),
// "The config file at '" + sessionFactoryConfigPath + "' could not be found");
cfg.Configure(sessionFactoryConfigPath);
}
else
{
cfg.Configure();
}
// Now that we have our Configuration object, create a new SessionFactory
sessionFactory = cfg.BuildSessionFactory();
When I run this I get the following error at sessionFactory = cfg.BuildSessionFactory();
"FATAL: XX000: could not accept SSPI security context"
When I checked the PostgreSQL logs the following entry was found:
"The token supplied to the function is invalid (80090308)"
I am using "PostgreSQL 9.3.2, compiled by Visual C++ build 1600, 32-bit". I got it from postgres website. I am using Windows 7 SP1 64-bit.
What am I missing here? Please help.