MySQL Load Error: Resolving the Issue
When executing the following MySQL command at the bash command line:
mysql -e "load data local infile \ '/tmp/ept_inventory_wasp_export_04292013.csv' into \ table wasp_ept_inv fields terminated by ',' \ lines terminated by '\n' ;"
users may encounter the error "ERROR 1148 (42000) at line 1: The used command is not allowed with this MySQL version."
Workaround
This issue can be circumvented by modifying the MySQL command line. Pass in the --local-infile=1 argument before the user and password arguments:
mysql --local-infile=1 -u username -p
After entering the MySQL prompt, execute the LOAD DATA LOCAL INFILE command again. This should resolve the error and allow the data to be loaded into the specified table.
Note: Modifying the my.cnf configuration file to globally enable local infile loading is not recommended for this specific case, as the user desires a more localized solution.
The above is the detailed content of How to Resolve \"ERROR 1148 (42000): The used command is not allowed with this MySQL version\" When Using LOAD DATA LOCAL INFILE?. For more information, please follow other related articles on the PHP Chinese website!