0

I added cleardb to my Heroku app.

config:

CLEARDB_DATABASE_URL: mysql://username:password@us-cdbr-iron-east-04.cleardb.net/databse?reconnect=true

DATABASE_URL: mysql2://username:password@us-cdbr-iron-east-04.cleardb.net/database?reconnect=true

Procfile:

web: target/universal/stage/bin/playeditor -Dhttp.port=${PORT} -Ddb.default.driver=com.mysql.jdbc.Driver -Ddb.default.url=${DATABASE_URL} -Dplay.crypto.secret=${APPLICATION_SECRET}

When I try to test the database connection(add server connection in MySQL Workbench) :

Can't connect to MySQL server on 'us-cdbr-iron-east-04.cleardb.net' (60)

And I tried another way:

mysql -u username -p -h us-cdbr-iron-east-04.cleardb.net

I also get the same error.

The firewall is off from the beginning.

Community
  • 1
  • 1
이국화
  • 809
  • 1
  • 9
  • 8

2 Answers2

0

First, try using JDBC_DATABASE_URL instead like this:

web: ... -Ddb.default.url=${JDBC_DATABASE_URL} ...

If that still doesn't work, try using the JawsDB add-on instead of ClearDB. I have far fewer problems with it:

$ heroku addons:destroy DATABASE
$ heroku addons:create jawsdb:kitefin

You should not need to change any code for JawsDB.

codefinger
  • 10,088
  • 7
  • 39
  • 51
-2

the hostname in your URL must be a real hostname, if your mysql is on local server it should be localhost or it should be the IP of remote server.

crazy0x
  • 1
  • 1