LoginSignup
35
30

More than 5 years have passed since last update.

Heroku (Rails) で MySQL 使う。

Last updated at Posted at 2014-07-27

ClearDB, JawsDB

Addon を追加

$ heroku addons:add cleardb:ignite

or

$ heroku addons:create jawsdb:kitefin

環境変数の設定

$ heroku config | grep CLEARDB_DATABASE_URL
CLEARDB_DATABASE_URL:       mysql://<username>:<password>@<host>/<databse>?reconnect=true

or

$ heroku config |grep JAWSDB_URL
JAWSDB_URL:       mysql://<username>:<password>@<host>/<databse>

ドライバを mysql2 に変更

$ heroku config:set DATABASE_URL='mysql2://<username>:<password>@<host>/<database>?reconnect=true'

メモ

  • ClearDB の id(auto_increment) は 10ずつ増える
  • ClearDB の MySQL のバージョンは 5.5系
  • JawsDB の MySQL のバージョンは 5.7系

参考・引用

35
30
1

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
35
30