📜  Rails 中的动态数据库连接 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:45.409000             🧑  作者: Mango

代码示例1
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'name',
:password => 'password',
:database => 'db_name'
)