eclipse luna and postgres db 9.4 connection - eclipse

I am trying to connect postgres in eclipse. But I am getting below error after entering all details for jdbc connection:
Database:postgres
url:jdbc:postgresql://localhost:5432/postgres
user name:postgres
pass :postgres
jar file:D:\Workspace: postgresql-9.4-1202.jdbc41
Ping failed:
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:427)
at

Related

FATAL: password authentication failed for user "postgres" (macOS, postgresql 15.1, pgAdmin 4)

After installing PSQL 15.1 (https://www.postgresql.org/download/), I try to connect to the server, enter the password that I set during installation. But I am getting this error [connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres"]
enter image description here
Any idea how can I fix this? Thanks!

fatal error : ssl closed pg_hba.conf site, database tool can connect to postgre but in code throw exception

I use flink cdc 2.0.0 to connect to postgresql in vmware.
I can connect to mysql in VM and do the SELECT in my code. But I can't do the same to postgres. And it throw an exception 'FATAL: no pg_hba.conf entry for host "192.168.42.1", user "postgres", database "mydb", SSL off error'
Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.42.1", user "postgres", database "mydb", SSL off error
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217)
at org.postgresql.Driver.makeConnection(Driver.java:458)
at org.postgresql.Driver.connect(Driver.java:260)
at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$1(JdbcConnection.java:231)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:872)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:867)
at io.debezium.connector.postgresql.TypeRegistry.<init>(TypeRegistry.java:122)
... 8 more
Suppressed: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.42.1", user "postgres", database "mydb", SSL off error
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:206)
... 16 more
I have modified the settings in pg_hba.conf and postgresql.conf:
host all all all trust # at the bottom of the file
listen_addresses = '*'
And it's weird that there's no problem using the database tool DBeaver, this can create and select...
Here's my code:
DebeziumSourceFunction<String> source = PostgreSQLSource.<String>builder()
.hostname("192.168.42.130")
.port(5432)
.username("postgres")
.password("123456")
.database("mydb")
.schemaList("public")
.tableList("big_data_public.public.user")
.deserializer(new StringDebeziumDeserializationSchema())
.build();
The ip '192.168.42.130' is the ip of my VM.
The ip '192.168.42.1' is the ip of VMware Network Adapter VMnet8.(I don't understand why the code throw an exception with this IP)

failed: FATAL: password authentication failed for user "xxx" - Windows

I'm using Windows 8.1 PosgreSQL 9.5 and withn I try to exeucte pg_dump and asking for the password after I enter the correct password, I'm getting this error:
What do I need to do?
pg_dump: [archiver (db)] connection to database "Nick" failed: FATAL:
password authentication failed for user "Nick"
I do not have database called "Nick" in my postgreSQL

Couldn't connect to server apollo.modulusmongo.net

I'm trying to connect MongoDB database on modulus.io by referencing [this][1] tutorial.
I've registered with modules .io and received the database url. (Modulus provides the database URL you need and you can use mongoose.connect to connect to it)
i.e.
MONGO URI
mongodb://<user>:<pass>#apollo.modulusmongo.net:27017/wIp4otyd
MONGO CONSOLE
mongo apollo.modulusmongo.net:27017/wIp4otyd -u <user> -p <pass>
But when I'm trying to connect it through both node.js and console its showing me following error:
C:\mongodb\bin>mongo apollo.modulusmongo.net:27017/wIp4otyd -u <my_uname> -p <my_pwd>
2016-02-04T12:01:07.097+0530 I CONTROL [main] Hotfix KB2731284 or later update is installed, no need to zero-out data files
MongoDB shell version: 3.2.1
connecting to: apollo.modulusmongo.net:27017/wIp4otyd
2016-02-04T12:01:09.455+0530 W NETWORK [thread1] Failed to connect to 52.6.181.208:27017, reason: errno:10061 No connection could be made because the target ma
chine actively refused it.
2016-02-04T12:01:09.457+0530 E QUERY [thread1] Error: couldn't connect to server apollo.modulusmongo.net:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:226:14
#(connect):1:6
exception: connect failed
Its connecting to local perfectly (mongoose.connect('mongodb://localhost/news');)
but refusing to modulus.io (mongoose.connect('mongodb://<my_uname>:<my_pwd>#apollo.modulusmongo.net:27017/wIp4otyd');)

Trying to run play application in console on heroku

I'm trying to start a play application in a console on heroku using this line of code:
new play.core.StaticApplication(new java.io.File("."))
Unfortunately it seems to be having a problem connecting to my database. I'm using postgres. Here's my configuration from application.conf
db.default.driver=org.postgresql.Driver
db.default.url=${?DATABASE_URL}
db.default.user=myusername
db.default.password=mypassword
My app is able to access the database through regular use. Here's the error i'm getting:
c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.net.ConnectException: Connection refused.Message:Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Configuration error: Configuration error[Cannot connect to database [default]]