Home  >  Article  >  Database  >  Why is LOAD DATA LOCAL INFILE not allowed in my MySQL version and how can I fix it?

Why is LOAD DATA LOCAL INFILE not allowed in my MySQL version and how can I fix it?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-01 01:10:02499browse

Why is LOAD DATA LOCAL INFILE not allowed in my MySQL version and how can I fix it?

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:

  • http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html
  • http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_local-infile

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!

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