1

I have a Java application that uses Hibernate. It's configured to write to a MySQL db. I can say that I configured it correctly because when I run it on my local machine (on Tomcat and Jetty), tables are created in my local db.

However, when I deploy it to Heroku, the tables are not created. Heroku logs:

Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'po
stgres://zzz:[email protected]
mazonaws.com:5432/zzz'

Logs

Why is Heroku connecting to this db instead of using my configurations?

Additional info: App is deployed. It's just that the db tables are not created.

2 Answers 2

1

It looks like you're trying to establish a MySQL connection to a Postgres database. Either use a Postgres driver instead, or use a MySQL database.

Look here for MySQL databases: https://addons.heroku.com

PS. I'm guessing you used the default Heroku Postgres database - which populates DATABASE_URL with a Heroku Postgres Starter Tier database.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi @Jon, to be sure, I did 'heroku pg' and it showed app has no heroku-postgresql databases. I wonder if this is a bug in Heroku's celadon cedar stack.
If you don't have a free postgres database, then you don't have one. That's not a bug. If you want one, execute heroku addons:add heroku-postgresql:dev
Jon, thanks for the reply. What I meant was related to my original question. If I don't even have a postgre db in my add ons, yet I can see a postgre error in the heroku logs, it must be a heroku bug, particularly in the celadon cedar stack
0

You need to point the DATABASE_URL variable to mysql database.

heroku config:set DATABASE_URL=mysql://xxxxxx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.