d6t / d6tstack

Quickly ingest messy CSV and XLS files. Export to clean pandas, SQL, parquet
MIT License
195 stars 46 forks source link

_mysql_connector.MySQLInterfaceError: LOAD DATA LOCAL INFILE file request rejected due to restrictions on access #30

Open thiagomacedoarco opened 2 years ago

thiagomacedoarco commented 2 years ago

I've been using d6stack for months and have never had any problems, but recently this error message appeared below. How can I do to be able to solve this, without having to change the variables or permissions of my database?

I think there's something connected to mysqlconnector. Is there another way to use it other than for this driver? For example: pymysql

[2022-01-07 15:40:35,524] {bash_operator.py:126} INFO - [2022-01-07 15:40:31] Insert - SaldosB2C IS [2022-01-07 15:40:35,524] {bash_operator.py:126} INFO - creating tb_saldos_b2c_iss.csv ok [2022-01-07 15:40:35,525] {bash_operator.py:126} INFO - loading tb_saldos_b2c_iss.csv ok [2022-01-07 15:40:35,535] {bash_operator.py:126} INFO - Traceback (most recent call last): [2022-01-07 15:40:35,536] {bash_operator.py:126} INFO - File "/usr/local/airflow/.local/lib/python3.7/site-packages/mysql/connector/connection_cext.py", line 519, in cmd_query [2022-01-07 15:40:35,537] {bash_operator.py:126} INFO - query_attrs=self._query_attrs) [2022-01-07 15:40:35,537] {bash_operator.py:126} INFO - _mysql_connector.MySQLInterfaceError: LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.

marksparrish commented 2 years ago

Did you update your mysql? I think there was a change to the default. You need to

SET PERSIST local_infile = 1;

in your cnf file.