Skip to content

Commit ecb675b

Browse files
committed
Add secure_auth option description and ActiveRecord database.yml example to README.md
1 parent 91f6c1b commit ecb675b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Mysql2::Client.new(
111111
:secure_auth = true/false
112112
)
113113
```
114+
### Multiple result sets
114115

115116
You can also retrieve multiple result sets. For this to work you need to connect with
116117
flags `Mysql2::Client::MULTI_STATEMENTS`. Using multiple result sets is normally used
@@ -128,6 +129,22 @@ end
128129

129130
See https://gist.github.com/1367987 for using MULTI_STATEMENTS with Active Record.
130131

132+
### Secure auth
133+
134+
Starting wih MySQL 5.6.5, secure_auth is enabled by default on servers (it was disabled by default prior to this). This option causes the server to block connections by clients that attempt to use accounts that have passwords stored in the old (pre-4.1) format. It also causes clients to refuse to attempt a connection using the older password format. To bypass this restriction in the client, pass the option :secure_auth => false to Mysql2::Client.new(). If you using ActiveRecord, your database.yml might look something like this:
135+
136+
```
137+
development:
138+
adapter: mysql2
139+
encoding: utf8
140+
database: my_db_name
141+
username: root
142+
password: my_password
143+
host: 127.0.0.1
144+
port: 3306
145+
secure_auth: false
146+
````
147+
131148
## Cascading config
132149
133150
The default config hash is at:

0 commit comments

Comments
 (0)