Home > Database > Mysql Tutorial > Why does \'LOAD DATA INFILE\' Fail with \'The Used Command is Not Allowed with This MySQL Version\'?

Why does \'LOAD DATA INFILE\' Fail with \'The Used Command is Not Allowed with This MySQL Version\'?

Susan Sarandon
Release: 2024-10-30 03:13:29
Original
1084 people have browsed it

Why does

LOAD DATA INFILE Fails with "The Used Command is Not Allowed with This MySQL Version"

When attempting to use the LOAD DATA INFILE command in PHP to import data from a CSV file, users may encounter an error message indicating that the command is incompatible with the MySQL version. This issue can be attributed to the local_infile server variable being disabled.

To address this issue without altering server settings, a potential workaround is to run MySQL using the --local-infile=1 option. By launching MySQL from the console as follows:

mysql -u USER -p --local-infile=1 DATABASE
Copy after login

You should then be able to execute the LOAD DATA command successfully. If this approach proves effective, it may be necessary to persistently enable local file loading by modifying the MySQL configuration or reinstalling the software with the appropriate compile-time option.

The above is the detailed content of Why does 'LOAD DATA INFILE' Fail with 'The Used Command is Not Allowed with This MySQL Version'?. 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