MongoserverError: bad auth: authentication failed problem - mongodb

I correctly use the username and password in the url of vs code for my server side but in the cmd i find the error of mongodb authentication fail. why this is happening?

rewrite the uri again and give the username and password again. sometimes connection fails. that's why it happens. hope problem will be solved.

Related

MongoDB + Adminer

I am running a local MongoDB service on Windows using WAMP64.
I want to access the db using Adminer. I cannot get thru the login page.
It keeps saying that Database does not support password, which it does as proven by me logging into the db using MongoDB Compass with the created auth uid and pw.
I have tried Adminer 4.6.3 and 4.7.6 (lastest v)
Anyone know how to get past this? Thanks.
The code that produces this message seems to be here.
What it appears to do is:
Connect with the provided username and password.
Connect with the provided username with an empty password.
If the second connection succeeds, return the "does not support password" error.
Otherwise, presumably return the first connection.
If I try to login without a password, even if mongod was not started with --auth parameter, my login fails. So I'm not sure what setup is needed to reproduce this behavior, but I suggest:
Ensuring your mongod invocation has --auth parameter.
Ensuring you are not able to connect to your server without specifying the password (i.e., unauthenticated connection fails).
The thing you need to do is to add a user. You don't have to run mongo with authentication enabled; if you add a user adminer will accept the auth and just work. Just run mongo:
db.createUser({
... user: "admin",
... pwd: "PASSWORD",
... roles: ["readWrite","dbAdmin"]
... })
and then you'll be able to log in with adminer

unable to login to pgAdmin4

after installing binary version (10.11.3) of postgressql, i set the username and password and username and started pgAdmin4. it was asking password to login but whenever i give correct password, it was giving incorrect password. So i reset MASTER_PASSWORD= false in
postgresql-10.11-3-windows-x64-binaries\pgsql\pgAdmin 4\web\congig.py file. I restarted the server. i am getting the below screen and i am unable to login.
I am not sure what is the problem.

Adonis isn't migrating

I've installed mysql npm in my adonis project and also set DB_CONNECTION=mysql in .env.
Everything in my .env is correct, but when i run the migration cmd i get an error.
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlMessage: "Access denied for user 'root'#'172.17.0.1' (using password: YES)",
sqlState: '28000',
fatal: true
I don't have any clue whats going on, i google the error but no solution was found.
And why its saying 'root'#'172.17.0.1' if localhost is 127.0.0.1?
What should i do?
As the error message implies, you're having an authorization problem.
You said that your .env file is correct, but double check if it contains the following variables:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1 //make sure it's your localhost
DB_PORT= //usually 3306
DB_USER=
DB_PASSWORD=
DB_DATABASE=
Then, check if your config/database.js file is properly calling the .env variables, without any typo or missmatched name.
If it is all fine and the problem continues, he i suggest you to check your database credentials.
Try acessing it without password, since some default configurations to mysql databases uses the username root and an empty password. (in the error message you received a (using password: YES))
If you double checked all that and are still getting this error, I recommend you to create another Database User with root privileges.

Error connecting to the Server in postgreSQL

I am trying to add a connection to the server in postgreSQL. But when I fill all the details I get this error
Error connecting to the server: FATAL: role "abc" does not exist.
"abc" is the username I want to create.
I am using Tomcat server eclipse for this.
Please help me find a solution to this problem.
Thanks in advance!
If the user does not yet exist, you will have to login as the admin and create it before you can login as that user.

MySQL Connector/MXJ: authentication issue

I would like to get started with MySQL Connector/MXJ. I am not sure how the authentication works. Where do I specify the actual user/password pair before connecting to mysqld?
I tried the following URL connection to no avail:
jdbc:mysql:mxj://localhost:3336/bignibouTest?server.basedir=/home/julien/tmp&createDatabaseIfNotExist=true&server.initialize-user=true&server.initialize-user-name=root&server.initialize-user-password=root
I systematically get "java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)".
Maybe it if someone could let me know how not to use a password, it would work.
One satisfactory workaround I found it to specify server.initialize-user=false and use:
user:"root"
password:""
in other words, MySQL's default password for root seems to be an empty string.
As far as unit tests are concerned this is OK.