I'm trying to use the MySqlHook.bulk_load() method docs in my Airflow task, and if my understanding is correct, I have to enable "local_infile" and "loose-local-infile" when I create the connection to my MySQL database in order for this to work.
Otherwise, it results in the following error: "The used command is not allowed with this MySQL version."
If I create my connection from the Connections page on the webserver UI, and pass the following parameters as "extras", the method is successful and the DAG works as intended: {"local_infile":"1","loose-local-infile":"1"} image of connection settings on Airflow webserver UI
However, I am looking create my database connection by passing it as an environmental variable instead. To do so, requires me to pass my connection settings as a URI. see "Connections" in docs
ie: scheme://[user[:[password]]@]target[:port][/schema][?attribute1=value1&attribute2=value2...
docs
I have tried the following formats, but none have worked successfully for me:
mysql://user:password@hostname:port/schema?local_infile=1&loose-local-infile=1
mysql://user:password@hostname:port/schema?local_infile=1;loose-local-infile=1
I have also tried percent encoding my values like so:
mysql://user:password@hostname:port/schema?local_infile%3D1%26loose-local-infile%3D1
Any help would be GREATLY appreciated, thank you!