Home >Database >Mysql Tutorial >How to Enable LOAD DATA LOCAL INFILE in MySQL on Ubuntu?
Unveiling LOCAL DATA INFILE in MySQL on Ubuntu: A Guide
As you grapple with the elusive "The used command is not allowed with this MySQL version" error while attempting to enable LOAD DATA LOCAL INFILE, let's delve into the inner workings of MySQL to find a solution.
According to the MySQL 5.5 documentation, LOCAL INFILE only functions when both the server and client are configured to allow it. This suggests that you may have missed a crucial step in configuring your settings.
To rectify this issue, you need to add the option "local-infile=1" to your my.cnf file within the [mysql] entry. Alternatively, you can launch the MySQL client with the "--local-infile" parameter.
For an instant fix, you can modify the global variable at runtime using the following query:
SET GLOBAL local_infile=ON;
Remember, it's imperative to define the "local-infile" parameter in your [mysqld] section of the my.cnf file as well. This ensures that the "local infile" feature is enabled server-side.
It's worth noting that these restrictions are in place for security reasons. By configuring "local-infile" appropriately, you can safeguard your database against potential vulnerabilities.
The above is the detailed content of How to Enable LOAD DATA LOCAL INFILE in MySQL on Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!