0

I have installed apache airflow locally on windows system on ubuntu WSL. I have created a tag consisting of two task. First task is fetching the data from data source and storing in data frame. Second task is sending data to database from data frame. My first task got executed and pulled the data to second task using xcom. Even giving correct connection credentials I am getting this error("Error while connecting to mysql"). I have used hooks too but still the same error. I am not getting what other configurations i have to do and why am I getting this error? Please suggest something.

  • Could you give more details or show some parts of your code? – Eduardo Freire Mangabeira Jul 01 '21 at 15:13
  • ok. 1. I have installed airflow locally on windows. I am not using docker. I have used ubuntu WSL. 2. MySQL dB is hosted on edge server of my office. 3. I have correctly applied all the credentials too. I have even created connections and used MySQL hooks. I have made changes of SQLite connection in .cfg file. I am not getting why still I am not able to connect to MySQL. In your opinion what are the must things to connect it to dB and where I am doing wrong? – kajal khambari Jul 01 '21 at 16:30
  • I would need to take a look at the part of your code where you connect to MySQL to know exactly what is going wrong, but just for clarification, this error `error("Error while connecting to mysql")` is displayed by Airflow webserver UI, right? Also, as you are communicating between tasks, take a look at this [question](https://stackoverflow.com/questions/46059161/airflow-how-to-pass-xcom-variable-into-python-function), it might have something useful or something that you are missing. – Eduardo Freire Mangabeira Jul 01 '21 at 17:01

0 Answers0