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

Support for other drivers for MySQL database #798

Open
2 of 4 tasks
turuncuofke opened this issue Oct 23, 2023 · 0 comments
Open
2 of 4 tasks

Support for other drivers for MySQL database #798

turuncuofke opened this issue Oct 23, 2023 · 0 comments
Labels
kind/enhancement kind - new features or changes

Comments

@turuncuofke
Copy link

Checks

Motivation

I am currently using airflow version "2.7.0-python3.11" with the chart version "8.8.0" and I am using an external MySQL database. I am getting "WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version." logs from my airflow cluster.

After some research, I realized that these warning logs are coming because of the database driver I use. When I wanted to change the driver I use for database connection to "mysql-connector-python" from "mysqlclient" I had some problems with changing the database connection string since it is given as DATABASE_SQLALCHEMY_CMD: {{ `echo -n "mysql+mysqldb://$(eval $DATABASE_USER_CMD):$(eval $DATABASE_PASSWORD_CMD)@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_DB}${DATABASE_PROPERTIES}"` | b64enc | quote }}
with hardcoded database driver in the "secret-configs-env-yaml" file in the chart.

As a workaround, I overrode this "DATABASE_SQLALCHEMY_CMD" env variable using airflow.extraEnv in the values.yaml as:
Screenshot 2023-10-23 at 11 15 21
Since it is available in Airflow 2.7.0 https://airflow.apache.org/docs/apache-airflow/2.7.0/howto/set-up-database.html#setting-up-a-mysql-database

Could this driver parameter in database connection string also be a variable which can be set in the values.yaml?

Implementation

No response

Are you willing & able to help?

  • I am able to submit a PR!
  • I can help test the feature!
@turuncuofke turuncuofke added the kind/enhancement kind - new features or changes label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement kind - new features or changes
Projects
None yet
Development

No branches or pull requests

1 participant