0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

herokuのPostgreSQL/MySQLへ接続

Posted at

はじめに

herokuにて作成したDBへ、ターミナルから接続したい時の備忘録

PostgreSQL

以下のコマンドでデータベースへ接続可能

$ heroku pg:psql -a <herokuアプリ名>  #https://<herokuアプリ名> .herokuapp.com/

また、以下のコマンドで詳細情報確認可能。

$ heroku pg:info -a <heroku アプリ名>

MySQL

以下のコマンドでCLEARDB_DATABASE_URLを確認

$heroku config -a <heroku アプリ名>

CLEARDB_DATABASE_URL: mysql://"Username":"Pssword"@us-cdbr-east-02.cleardb.net/heroku_"Database"?reconnect=true

以下のコマンドでデータベースへ接続

mysql -u Username -p -h us-cdbr-east-02.cleardb.net heroku_Database
Enter password: Password
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?