Home > Database > Mysql Tutorial > body text

Here are a few title options, keeping in mind the question format and focusing on the core issue: Direct and Concise: * Why Does \'LOAD DATA INFILE\' Throw \'The used command is not a

Linda Hamilton
Release: 2024-10-27 20:19:30
Original
373 people have browsed it

Here are a few title options, keeping in mind the question format and focusing on the core issue:

Direct and Concise:

* Why Does

Troubleshooting "The used command is not allowed with this MySQL version" Error in LOAD DATA Local Infile

In an attempt to load data from CSV files using PHP's LOAD DATA INFILE function, users may encounter an error stating "The used command is not allowed with this MySQL version." This issue may occur if the server variable local_infile is set to 'off.'

Alternative Workaround:

While changing server settings is not an ideal solution, consider the following workaround:

  1. Log in to the console as the same user encountering the error.
  2. Execute the LOAD DATA command. If the same error occurs:
    a. Close the console and run:
    mysql -u USER -p --local-infile=1 DATABASE
    b. Retry executing the LOAD DATA command.

If successful, it indicates that MySQL was started with the --local-infile flag disabled. To resolve this issue permanently:

  1. Restart MySQL with the --local-infile flag:
    a. For Windows: mysqld --local-infile=1
    b. For Linux/Unix: sudo service mysql restart --local-infile=1
  2. Re-install MySQL with the local-infile option enabled:
    a. Refer to MySQL documentation for specific instructions.

Additional Considerations:

  • If phpMyAdmin accepts CSV files despite using the same server, it may be using other methods for file loading.
  • References for MySQL version 5.0 are provided, which have proven effective in resolving the issue in MySQL 5.5.

The above is the detailed content of Here are a few title options, keeping in mind the question format and focusing on the core issue: Direct and Concise: * Why Does \'LOAD DATA INFILE\' Throw \'The used command is not a. 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!