Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザー名/パスワードの組み合わせを渡さずに .my.cnf ファイルからロードする代わりに、mysql gem を使用して MySQL サーバーに接続する方法はありますか?
それらをロードする最も簡単な方法は、inifilegem を使用することです。
inifile
require 'inifile' client_options_hash = IniFile.new('~/.my.cnf')['client']
次に、からの値を使用client_options_hashして接続をセットアップできます。
client_options_hash