Skip to content

Commit

Permalink
Merge pull request #67 from navashiva/feature/mysql-5.x-ssl-mode
Browse files Browse the repository at this point in the history
Added optional ssl_disabled property
  • Loading branch information
dbeatty10 authored Feb 19, 2022
2 parents cde8555 + 7351f9b commit bd4770e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ your_profile_name:
schema: analytics
username: your_mysql_username
password: your_mysql_password
ssl_disabled: True
```

| Option | Description | Required? | Example |
Expand All @@ -107,6 +108,7 @@ your_profile_name:
| schema | Specify the schema (database) to build models into | Required | `analytics` |
| username | The username to use to connect to the server | Required | `dbt_admin` |
| password | The password to use for authenticating to the server | Required | `correct-horse-battery-staple` |
| ssl_disabled | Set to enable or disable TLS connectivity to mysql5.x | Optional | `True` or `False` |

### Notes

Expand Down
4 changes: 4 additions & 0 deletions dbt/adapters/mysql5/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MySQLCredentials(Credentials):
username: Optional[str]
password: Optional[str]
charset: Optional[str]
ssl_disabled: Optional[bool]

_ALIASES = {
"UID": "username",
Expand Down Expand Up @@ -76,6 +77,9 @@ def open(cls, connection):
kwargs["user"] = credentials.username
kwargs["passwd"] = credentials.password

if credentials.ssl_disabled:
kwargs["ssl_disabled"] = credentials.ssl_disabled

if credentials.port:
kwargs["port"] = credentials.port

Expand Down

0 comments on commit bd4770e

Please sign in to comment.