Correct MySQL configuration for Ruby on Rails Database.yml file

前端 未结 6 630
终归单人心
终归单人心 2020-12-02 08:03

I have this configuration:

development:
  adapter: mysql2
  encoding: utf8
  database: my_db_name
  username: root
  password: my_password
  host: mysql://12         


        
6条回答
  •  不思量自难忘°
    2020-12-02 08:55

    If you can have an empty config/database.yml file then define ENV['DATABASE_URL'] variable, then It will work

    $ cat config/database.yml
     
    $ echo $DATABASE_URL
    mysql://root:my_password@127.0.0.1:3306/my_db_name
    

    for Heroku: heroku config:set DATABASE_URL='mysql://root:my_password@host.com/my_db_name'

提交回复
热议问题