0
Static analysis:

1 errors were found during analysis.

    Unrecognized statement type. (near "optionally" at position 146)

SQL query:

-- Load data into FOOD_NAME load data local infile './data.processed/FOOD_NAME.csv.trimmed' into table FOOD_NAME fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' ignore 1 lines (FoodID, FoodCode, FoodGroupID, FoodSourceID, FoodDescription, FoodDescriptionF, @date1, @date2, CountryCode, ScientificName) set FoodDateOfEntry = str_to_date(@date1, '%Y-%m-%d'), FoodDateOfPublication = str_to_date(@date2, '%Y-%m-%d')

MySQL said: Documentation
#2000 - LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile

I edited my php.ini as advised here: https://stackoverflow.com/q/59747245/9481613

phpInfo

and set my.cnf:

mysql> show global variables like 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | OFF   |
+---------------+-------+
1 row in set (0.00 sec)

mysql> set global local_infile=true;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | ON    |
+---------------+-------+
1 row in set (0.01 sec)

What else am I supposed to adjust? I am trying to read in CSV files into a MySQL database, using phpmyAdmin, for a Flask app, as shown here: https://github.com/m5n/nutriana/blob/master/canadian_nf/dist/canadian_nf_mysql.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.