4

I'm using ClearDB with Heroku. I managed to make the migrations that I needed but when I can't find the way to execute queries using the terminal as below:

SELECT * from table .

Thanks in advance.

Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
Manu Mackwar
  • 61
  • 1
  • 6

1 Answers1

9

Format:

mysql -h host -uuser -ppassword

example:

mysql -h us-cdbr-east.cleardb.com -ubxxxxxx7 -p3xxxxxxx

How to find login info

Use this command in your heroku repo: heroku config

Look for the CLEARDB_DATABASE_URL

Format:

mysql://**user**:**password**@**host**/heroku_db_name?...

Example:

mysql://bxxxxxx7:3xxxxxxx@us-cdbr-east.cleardb.com/heroku_xxxxxx?...

After connecting, just USE heroku_db_name and query away!

Darwin von Corax
  • 5,201
  • 3
  • 17
  • 28
Jason Awbrey
  • 889
  • 9
  • 11