HEROKU connect to mysql database

2

I'm doing reverse engineering on a system, and I want to use the same database as the old system. But I am not able to connect the system bank in production with this database. And for being in MYSQL I'm using the mysql2 gem, as follows:

heroku config:set DATABASE_URL="mysql2://meuusuariodobaco:minhasenha@link_para_o_banco_de_dados?reconnect=true"

And with that my application is giving the following log:

2016-10-11T19:57:47.792510+00:00 heroku[router]: at=error code=H12 
desc="Request timeout" method=GET path="/" host=bsbmusical.herokuapp.com 
request_id=0fafefe8-3bfa-455c-b693-46ea7f0d3abf fwd="189.6.126.19" 
dyno=web.1 connect=1ms service=30001ms status=503 bytes=0

Detail: the password has a special character * (asterisk), can this be the cause?

I tried to connect in the hand too, but I could not:

production:
  <<: *default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: meuUsuario
  password: minhaSenha
  host: meuHost
  port: portaDoBanco
    
asked by anonymous 03.10.2016 / 19:03

1 answer

1

mysql in heroku is generated by an add-on, you will need to add it in your heroku app and follow the configuration steps - link

Something like:

# add cleardb add-ons to your app
$ heroku addons:add cleardb:ignite

# set CLEARDB_DATABASE_URL
$ heroku config:set DATABASE_URL='mysql://meuusuariodobaco:minhasenha@link_para_o_banco_de_dados?reconnect=true'

$ heroku config:set CLEARDB_DATABASE_URL='mysql://meuusuariodobaco:minhasenha@link_para_o_banco_de_dados?reconnect=true'
    
11.10.2016 / 20:25