Home > Database > Mysql Tutorial > body text

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
Release: 2024-10-28 16:27:30
Original
528 people have browsed it

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
Copy after login

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';
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!