I try to insert some lines from csv file to MySQL database "elevage" by command line. The file is names "animal.csv". Below is my request:
`mysql> LOAD DATA LOCAL INFILE 'F:/MYSQL/animal.csv'
-> INTO TABLE Animal
-> FIELDS TERMINATED BY ';' ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n'
-> (espece, sexe, date_naissance, nom, commentaires);
and I run into this error message
`ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides`.
Then have used the following code:
`SHOW GLOBAL VARIABLES LIKE 'local_infile'`;
and I found: local_file was "OFF". Then I tried to set it to "ON" using the following code :
`SET GLOBAL local_infile=1;`
Unfortunately, I run into another error message:
`ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation`
Although, when I check the grants for the user "student" in which I'm working:
mysql> SHOW GRANTS FOR CURRENT_USER();
I get:
+--------------------------------------------------------------+
| Grants for student@localhost |
+--------------------------------------------------------------+
| GRANT USAGE ON *.* TO `student`@`localhost` |
| GRANT ALL PRIVILEGES ON `elevage`.* TO `student`@`localhost` |
+--------------------------------------------------------------+
2 rows in set (0.00 sec)
which means that "student" has all the privileges on the database "elevage".
Please advice.
ON,1, andtrueall do the same thing when setting boolean variables.*.*. Are you using Amazon RDS? You can't set global variables directly on RDS. You must change variables using parameter groups.ON,1, andtruedo the same thing at least with respect tolocal_infile. When Iselect @@local_infile;to see the result, all three values are converted to1. LikewiseOFF,0, andfalseare converted to0.