我是Rails的新手,不知道如何在Rails单个应用程序中访问多个数据库。
我会这样尝试
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: root
socket: /var/run/mysqld/mysqld.sock
reconnect: true
development:
<<: *default
database: connection_development
<<: *default
database: connection_test
Run Code Online (Sandbox Code Playgroud)
log_database_production:
adapter: mysql2
encoding: utf8
pool: 5
host: 192.168.100.97
port: 3306 #ip address of server with other postgres database
username: root
password: root
database: hrms_development
reconnect: true
Run Code Online (Sandbox Code Playgroud)
那我不知道该怎么办..