Home  >  Article  >  Database  >  How do I fix the \"The used command is not allowed with this MySQL version\" error when using LOAD DATA LOCAL INFILE?

How do I fix the \"The used command is not allowed with this MySQL version\" error when using LOAD DATA LOCAL INFILE?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-10-28 16:27:30529browse

How do I fix the

MySQL Load Error: "The used command is not allowed with this MySQL version"

This error occurs when attempting to execute the LOAD DATA LOCAL INFILE command in MySQL version 5.5.31 or earlier. The error message indicates that this command is not supported in the current version of MySQL.

To work around this issue, you can modify the MySQL command line to include the --local-infile=1 argument. This argument explicitly enables the LOAD DATA LOCAL INFILE command for the current session.

mysql --local-infile=1 -u username -p

After executing the above command, you can then run the LOAD DATA LOCAL INFILE command as usual.

LOAD DATA LOCAL INFILE '/tmp/ept_inventory_wasp_export_04292013.csv' INTO TABLE wasp_ept_inv FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';

The above is the detailed content of How do I fix the \"The used command is not allowed with this MySQL version\" error when using LOAD DATA LOCAL INFILE?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn