문제

I am building a local Spring app to access the database I created on OpenShift at 127.2.xx.yy/eetom:3306. So I created this propery in Beans.xml.

<property name="url" value="jdbc:mysql://127.2.xx.yy:3306/eetom"/>

but I got exceptions such as

Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

and

The driver has not received any packets from the server

So I changed the ip to localhost and used OpenShift rhc to create port forwarding. And the rhc showed that the ip I put originally and the port are exactly used for port forwarding. That method workded.

Question:

What is the right way to access the mysql diectly without port forwarding?

도움이 되었습니까?

해결책

Someone helped me on this before, it's from OpenShift: OpenShift does not support direct connectivity to an embedded database on non-scalable applications.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top