Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update docs on MySQL recommended driver #14826

Merged
merged 3 commits into from May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/src/pages/docs/Connecting to Databases/mysql.mdx
Expand Up @@ -8,16 +8,22 @@ version: 1

## MySQL

The recommended connector library for MySQL is [mysql-connector-python](https://pypi.org/project/mysql-connector-python/).
The recommended connector library for MySQL is `[mysqlclient](https://pypi.org/project/mysqlclient/)`.

Here's the connection string:

```
mysql+mysqlconnector://{username}:{password}@{host}/{database}
mysql://{username}:{password}@{host}/{database}
```

Host:
- For Localhost or Docker running Linux: `localhost` or `127.0.0.1`
- For On Prem: IP address or Host name
- For Docker running in OSX: `docker.for.mac.host.internal`
Port: `3306` by default

One problem with `mysqlclient` is that it will fail to connect to newer MySQL databases using `caching_sha2_password` for authentication, since the plugin is not included in the client. In this case, you should use `[mysql-connector-python](https://pypi.org/project/mysql-connector-python/)` instead:

```
mysql+mysqlconnector://{username}:{password}@{host}/{database}
```