Skip to content

Commit 9804551

Browse files
authored
Update README to clarify the protocol value in DATABASE_URL
Resolves #1047
1 parent 4e221cf commit 9804551

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
@@ -278,8 +278,10 @@ The string form will be split on whitespace and parsed as with the array form:
278278
Plain flags are added to the default flags, while flags prefixed with `-`
279279
(minus) are removed from the default flags.
280280

281-
This allows easier use with ActiveRecord's database.yml, avoiding the need for magic flag numbers.
282-
For example, to disable protocol compression, and enable multiple statements and result sets:
281+
### Using Active Record's database.yml
282+
283+
Active Record typically reads its configuration from a file named `database.yml` or an environment variable `DATABASE_URL`.
284+
Use the value `mysql2` as the adapter name. For example:
283285

284286
``` yaml
285287
development:
@@ -297,6 +299,15 @@ development:
297299
secure_auth: false
298300
```
299301
302+
### Using Active Record's DATABASE_URL
303+
304+
Active Record typically reads its configuration from a file named `database.yml` or an environment variable `DATABASE_URL`.
305+
Use the value `mysql2` as the protocol name. For example:
306+
307+
``` shell
308+
DATABASE_URL=mysql2://sql_user:sql_pass@sql_host_name:port/sql_db_name?option1=value1&option2=value2
309+
```
310+
300311
### Reading a MySQL config file
301312

302313
You may read configuration options from a MySQL configuration file by passing

0 commit comments

Comments
 (0)