LOAD DATA Local Infile Error Handling
When encountering errors using LOAD DATA LOCAL INFILE, it's essential to investigate potential underlying causes.
One possible reason for the "The used command is not allowed with this MySQL version" error is that the local_infile server variable is set to off. This setting prohibits the usage of local data files for importing.
To circumvent this issue without modifying server settings, try logging into the MySQL console as the same user attempting to execute the LOAD DATA command. If the error persists, exit the console and launch MySQL using the command line option:
mysql -u USER -p --local-infile=1 DATABASE
Reattempting the LOAD DATA command should now be successful. If it works, you will need to restart MySQL with the command line option or reinstall MySQL with the appropriate configuration options.
For further guidance, refer to the following resources:
The above is the detailed content of Why is LOAD DATA LOCAL INFILE not allowed in my MySQL version and how can I fix it?. For more information, please follow other related articles on the PHP Chinese website!