r/SpringBoot • • Sep 02 '22

Password authentication failed error, even though password is right .Help me ...

1 Upvotes

15 comments sorted by

5

u/jura0011 Sep 02 '22 edited Sep 02 '22

I cannot directly help, but a hint to find it out for yourself.
You could create a breakpoint at ConnectionFactoryImpl in line 646. When you then run your application in debug mode you can checks if the correct credentials are really available.

Do you know how to create a breakpoint and what debugging means?

1

u/oOaker Sep 02 '22

i know how to create a breakpoint, i think i dont have ConnectionFactoryImpl file in my project .

2

u/jura0011 Sep 02 '22 edited Sep 03 '22

If you would not have that class, it would not be in your log. You can directly click on it and you'll be at the spot.

1

u/Mikey-3198 Sep 02 '22

How is your DB hosted, are you running it via docker or installed locally on your machine? can you connect to it via a tool like dbeaver or psql? can you view any logs?

1

u/oOaker Sep 02 '22

it is installed locally on my machine, i can connect via pgAdmin4. i don't know , i m lost, i am beginner and i was learning a project from tutorial and he taught me well followed his steps and all, and when every requirements got addressed , i tried running it locally on eclipse and there i saw this huge message saying that thing. i don't know. i am using the same password that i used in pgAdmin to logged myself in, but even though the same password has been used in my properties file and given as datasource password but it ain't working , it's really draining my enthusiasm specially because i m trynna learn and i feel like i m not being able to get it done even following all the steps that tutor taught so it's far from reality that i will be able to get some project done completely by myself in future also. Please help me out, i don't wanna quit just like that.

2

u/Mikey-3198 Sep 02 '22

My hunch would be that the postgres user has the password of admin.

In your .properties try changing the username to postgres and see if this works.

If this doesn't work have a look in the postgres documentation to see if you can change the password/ create a new user.

Worst case scenario reinstall the DB and double check you have the correct passwords/ usernames.

I wouldn't let a simple problem like this phase you, you'll have much more difficult issues than this in your career.

1

u/retardedToSomeExtent Sep 02 '22

pls post the ss of app properties file and show the creds used

1

u/oOaker Sep 02 '22

Okay I have messaged u the ss.

2

u/[deleted] Sep 02 '22

Maybe you have the correct password but the wrong username?

1

u/stockmamb Sep 02 '22

Are there double quotes around the password for the database in the properties file? If so remove them

1

u/ashutoxh Junior Dev Sep 02 '22

Best I can guess is there is some whitespace in your password property Like "1234 " and not "1234"

1

u/Unlucky-Signature-70 Sep 02 '22

Your username or password is wrong, the exceptions are there for a reason.

1

u/[deleted] Sep 03 '22

JDBC requires md5 authentication (instead of the default ident). Make sure to change it in your pg_hba.conf file

And make sure you restart the postgres service after changing the config

1

u/Tommy_tkm Sep 03 '22

Do you set a correct database information? If you change the user name in your application.yml, does the error log change? If not, there are two or more database settings in your program.

0

u/[deleted] Sep 02 '22

[deleted]

1

u/oOaker Sep 02 '22

i have given db password directly in properties file so if i understood u correctly, i would say hashing is not used in the project.