简体   繁体   中英

MySQL server not found in cloud foundry

I am trying to deploy my spring 3 + tomcat 6 + mysql 5.5 application on cloud foundry cloud. I am able to deploy application from Eclipse using STS plugin for cloudfoundry. Now issue i am getting is my application is not ablt to connect to database. I have configured a mysql service and started a tunnel. I have used tunnels username/password and URL to connect to database in application context file.

<Resource name="jdbc/myDB" auth="Container" type="javax.sql.DataSource"
           maxActive="10" maxIdle="3" maxWait="10000"
           username="xxx" password="xxx" driverClassName="com.mysql.jdbc.Driver"
           url="jdbc:mysql://127.0.0.1:10100/xxx?autoReconnect=true"/>

I am getting error.

Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

Can someone please help me. Also let me know how to upload my local sql database dump on cloud foundry DB because i think once i will be able to connect this is going to be another problem

Spring applications should automatically configure JDBC connections to services bound to the application. I would recommend having a good read through of the following wiki page;

http://docs.cloudfoundry.com/frameworks/java/spring/spring.html#determining-whether-your-application-can-be-auto-configured

As for connecting to the service externally, you can use the VMC client to tunnel to MySQL and then use MySQL to load a SQL dump, that's all explained on the following wiki page;

http://docs.cloudfoundry.com/tools/vmc/caldecott.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM