나는 스프링 웹 어플리케이션을 가지고 있으며, postgress와 연결하려고합니다. 여기 여기에 응용 프로그램이 에러 messege 얻을 개시 애플리케이션 컨텍스트spring과 hibrenate로 postgres SQL에 연결할 수 없습니다.
<bean id="appDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>${datasource.driver}</value>
</property>
<property name="url">
<value>${datasource.url}</value>
</property>
<property name="username">
<value>${datasource.username}</value>
</property>
<property name="password">
<value>${datasource.password}</value>
</property>
</bean>
인 DB 연결 속성
datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://localhost:5432/sampleDb
datasource.username=postgres
datasource.password=postgres
이다.
Cannot create PoolableConnectionFactory (Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
왜 이런 일이 발생합니까?
이 데이터베이스 형식을 다른 컴퓨터로 복원했습니다. 해당 SQL 파일에 무엇을 기록했는지 알지 못합니다. 해당 SQL 덤프 파일에 코드가 있습니다.
REVOKE ALL ON TABLE workflow_type FROM PUBLIC;
REVOKE ALL ON TABLE workflow_type FROM postgres;
GRANT ALL ON TABLE workflow_type TO postgres;
GRANT SELECT,INSERT,DELETE,REFERENCES,UPDATE ON TABLE workflow_type TO user1;
이 검색어로 인해 발생합니까?
나는 md5를 신뢰로 변경했습니다. 하지만 작동하지 않는다 –
pg_hba.conf를 저장하고 모든 md5를 신뢰로 변경하면 postgres를 다시 시작해야하며 다시 시도하십시오. 그리고 명령 줄을 통해 연결을 시도 했습니까? 그것은 작동합니까? –