Enable LOAD DATA LOCAL INFILE in MySQL
Problem:
How to enable LOAD DATA LOCAL INFILE in the MySQL configuration file (my.cnf) for MySQL 5.5 on Ubuntu 12 LTS.
Solution:
To enable LOAD DATA LOCAL INFILE, you need to add the following option to the [mysql] section of your my.cnf file:
local-infile=1
Alternatively, you can call the MySQL client with the --local-infile option:
mysql --local-infile -uroot -pyourpwd yourdbname
You can also set the global variable at runtime with the following query:
SET GLOBAL local_infile=ON;
Additional Note:
Ensure that the local-infile parameter is also defined in the [mysqld] section of the my.cnf file to enable the "local infile" feature server-side. This restriction is in place for security reasons.
The above is the detailed content of How to Enable LOAD DATA LOCAL INFILE in MySQL?. For more information, please follow other related articles on the PHP Chinese website!