Skip to content

Commit

Permalink
Update README to clarify the protocol value in DATABASE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew authored Jun 6, 2019
1 parent 4e221cf commit 9804551
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,10 @@ The string form will be split on whitespace and parsed as with the array form:
Plain flags are added to the default flags, while flags prefixed with `-`
(minus) are removed from the default flags.

This allows easier use with ActiveRecord's database.yml, avoiding the need for magic flag numbers.
For example, to disable protocol compression, and enable multiple statements and result sets:
### Using Active Record's database.yml

Active Record typically reads its configuration from a file named `database.yml` or an environment variable `DATABASE_URL`.
Use the value `mysql2` as the adapter name. For example:

``` yaml
development:
Expand All @@ -297,6 +299,15 @@ development:
secure_auth: false
```
### Using Active Record's DATABASE_URL
Active Record typically reads its configuration from a file named `database.yml` or an environment variable `DATABASE_URL`.
Use the value `mysql2` as the protocol name. For example:

``` shell
DATABASE_URL=mysql2://sql_user:sql_pass@sql_host_name:port/sql_db_name?option1=value1&option2=value2
```

### Reading a MySQL config file

You may read configuration options from a MySQL configuration file by passing
Expand Down

0 comments on commit 9804551

Please sign in to comment.