LoginSignup
0
0

More than 5 years have passed since last update.

Rails newでMySQL指定する方法(MySQL ver.8.0)

Last updated at Posted at 2018-09-27

個人的メモ

MySQL ver.8.0 の時のrailsの情報が少ないためQiitaでも作成
個人wiki https://hackmd.io/s/SkTtlb9FX

ステップ1 MySQLでuser作成

コマンドラインでMySQLにrootログインし、新規user作成
nameとpasswordは任意
mysql_native_password指定する事が大事

mysql>$ create user 'name'@'localhost' identified with mysql_native_password by 'password'

ステップ2 rails new

任意のディレクトリ内で

$ rails new アプリ名 -d mysql

次の2項目をステップ1で作成したものに変更

$ sudo vi ./config/database.yml
username
password

ステップ3 DB作成&migratre

rake db:create:all
rake db:migrate
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