LoginSignup
4
3

More than 5 years have passed since last update.

railsのDBをMySQLに変更する④~RailsのDBを途中からMysqlに変更するには~

Last updated at Posted at 2018-03-09

環境

□OS:Windows10 home
※bash on ubuntu on windows
□旧DB:SQLite
□新DB:Mysql5.7

手順

①Gemfileの編集

GemfileにMysql2を追加する

gem 'mysql2'

②データベースの設定ファイルを編集する

database.yml
  adapter: mysql2
  encoding: utf8
  database: TWINS_COM
  pool: 5
  username: root
  password:
  host: localhost

③bundle installを実行

$ bundle install

④データベース作成

$ bundle exec rake db:create
$ bundle exec rake db:migrate

これで変わった。

4
3
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
4
3