Skip to content

Commit 14975dc

Browse files
committed
Add docs for default_file and default_group
1 parent 115c8d6 commit 14975dc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ Mysql2::Client.new(
108108
:connect_timeout = seconds,
109109
:reconnect = true/false,
110110
:local_infile = true/false,
111-
:secure_auth = true/false
111+
:secure_auth = true/false,
112+
:default_file = '/path/to/my.cfg',
113+
:default_group = 'my.cfg section'
112114
)
113115
```
114116
### Multiple result sets
@@ -147,7 +149,16 @@ development:
147149
host: 127.0.0.1
148150
port: 3306
149151
secure_auth: false
150-
````
152+
```
153+
154+
### Reading a MySQL config file
155+
You may read configuration options from a MySQL configuration file by passing
156+
the `:default_file` and `:default_group` paramters. For example:
157+
158+
```
159+
client = Mysql2::Client.new(:default_file => '/user/.my.cnf', :default_group => 'client')
160+
```
161+
151162

152163
## Cascading config
153164

0 commit comments

Comments
 (0)