6
I deployed a project on OpenShift
, I used a Cartridge to create a bank Mysql
soon after the creation of the bank appear this information:
Mysql 5.5 database Added. Please make note of These credentials:
Root User: adminhtK8LZq Root Password: shKekKGKhHEH Database Name: Obolt
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
You can Manage your new Mysql database by also embedding phpmyadmin. The phpmyadmin username and password will be the same as the Mysql credentials above.
But when I set up mine hibernate.cfg
with this data the database is not created in the OpenShift
.
Hibernate.cfg:
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/oraculo </property>
<property name="connection.username">adminhtK8LZq</property>
<property name="connection.password">shKekKGKhHEH</property>
...
I have to pass some value in place of this URL, I tried to pass the ip that appears in phpMyAdmin
but it didn’t work.
Any reason for the pass given by Openshift and the pass on Hibernate.cfg to be different?
– João Gonçalves
And why would Hibernate create the bank? It is only able to create or update the tables in one existing bank. To do so, use
<property name="hibernate.hbm2dll.auto">create</property>
, orupdate
in place of create.– Caffé
The bank already exists and I am using create
– DiegoAugusto
You can access your Cartridge via ssh and see if you can connect using these credentials?
– guiandmag
Yes, I can access using these credentials by phpMyAdmin as well
– DiegoAugusto
vc has arrived put ip and port that so there in phpmyadmin there in mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ and make the deploy again ?
– Enzo Tiezzi
I tried yes, but it’s still the same. I’m going to do one more test.
– DiegoAugusto
I just tried again and nothing, when access to URL that would query the database is not created. URL:
http://sistemaoraculo-projetounimed.rhcloud.com/usuario/usuarios/consultar
– DiegoAugusto