Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Mysql commands with ClearDB in Heroku?

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.

like image 689
Manu Mackwar Avatar asked Jan 09 '23 01:01

Manu Mackwar


1 Answers

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:[email protected]/heroku_xxxxxx?...

After connecting, just USE heroku_db_name and query away!

like image 190
Jason Awbrey Avatar answered Jan 14 '23 01:01

Jason Awbrey