How can i perform a remote connect to ClearDB MySQL database on heroku using for example MySQL Query Browser. Where to get url, port, login and password?
Go to your app on heroku and click to the 'settings' tab. Then click the button on the second option that says 'reveal config vars'.
You should find, listed under the CLEARDB_DATABASE_URL variable, something like this...
mysql://[username]:[password]@[host]/[database name]?reconnect=true
So the [host portion] is your host. The [database name] portion is your db name, of course.
You still need your username and password. Go back to the 'overview' tab in heroku. Go to the ClearDB add-on in your installed add-ons section. Click the database you want to access (probably only 1 option there). Click the 'system information' tab. You should see your username and password.
that should be all you need to access your database. I use sequel pro. I just plugged that info (name, host, into the 'standard' tab and I was good to go.
In heroku website, go to My Apps and select the app on which you have installed ClearDB.
On the top corner click on Addons and then select ClearDB MySQL Database.
Once there, click on your database and choose the 'Endpoint Information' tab. There you see your username/password. The URL to the database can be acquired by running
heroku config --app <YOUR-APP-NAME>
in the command line.
In my case, it was something like: mysql://user:pass@us-cdbr-east.cleardb.com/DATABASE
?reconnect=true
What you need is this part: us-cdbr-east.cleardb.com
for windows users, there is no grep command.
in this way just try for windows users
heroku config
you will get config.
in another way go to settings in Heroku. then config var to check the variable.
Paste this command in terminal
heroku config | grep CLEARDB_DATABASE_URL
After this you will get Database URL. e.g this is your cleardb database URL.
'mysql://b0600ea495asds:9cd2b111@us-cdbr-hirone-west-
06.cleardb.net/heroku_4a1dc3673c4114d?reconnect=true'
Than this will be your database credentials. (Extracted from Above URL)
USER NAME = b0600ea495asds
PASSWORD = 9cd2b111
HOST = us-cdbr-hirone-west- 06.cleardb.net
DATABASE NAME = heroku_4a1dc3673c4114d
Paste this inside terminal:
heroku config | grep CLEARDB_DATABASE_URL
All of this worked perfectly for me. Using heroku config | grep, as described above and then simply adding another entry into my config.inc.php for use by phpMyAdmin and I can access my cleardb database remotely. It saves me having to have SQL locally and using postgres with Heroku.