rails 配置使用mysql

1 在gemfile中要添加

  gem 'mysql2'

 

2 在mysql数据库中创建三个数据库

  dept_dev

  dept_test

  dept_pro

3 配置文件

  

default: &default
adapter: mysql2
encoding: utf8
username: user1
password: 123
host: 127.0.0.1
port: 3306

development:
<<: *default
database: dept_dev


test:
<<: *default
database: dept_test

production:
<<: *default
database: dept_pro
posted on 2016-06-25 10:03  c3tc3tc3t  阅读(599)  评论(0编辑  收藏  举报