database.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # MySQL. Versions 5.5.8 and up are supported.
  2. #
  3. # Install the MySQL driver
  4. # gem install mysql2
  5. #
  6. # Ensure the MySQL gem is defined in your Gemfile
  7. # gem 'mysql2'
  8. #
  9. # And be sure to use new-style password hashing:
  10. # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
  11. #
  12. default: &default
  13. adapter: mysql2
  14. encoding: utf8mb4
  15. pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  16. username: <%= Rails.application.credentials.database[:user] %>
  17. password: <%= Rails.application.credentials.database[:password] %>
  18. database: <%= Rails.application.credentials.database[:name] %>
  19. socket: /var/run/mysqld/mysqld.sock
  20. development:
  21. <<: *default
  22. # Warning: The database defined as "test" will be erased and
  23. # re-generated from your development database when you run "rake".
  24. # Do not set this db to the same as development or production.
  25. test:
  26. <<: *default
  27. # As with config/credentials.yml, you never want to store sensitive information,
  28. # like your database password, in your source code. If your source code is
  29. # ever seen by anyone, they now have access to your database.
  30. #
  31. # Instead, provide the password or a full connection URL as an environment
  32. # variable when you boot the app. For example:
  33. #
  34. # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
  35. #
  36. # If the connection URL is provided in the special DATABASE_URL environment
  37. # variable, Rails will automatically merge its configuration values on top of
  38. # the values provided in this file. Alternatively, you can specify a connection
  39. # URL environment variable explicitly:
  40. #
  41. # production:
  42. # url: <%= ENV['MY_APP_DATABASE_URL'] %>
  43. #
  44. # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
  45. # for a full overview on how database connection configuration can be specified.
  46. #
  47. production:
  48. <<: *default