Are you getting the above error message? Are you attempting to import data from a file into MySQL using LOAD DATA LOCAL INFILE?
The reason this message crops up is due to a security setting in the MySQL configuration file (my.cnf). The following tweak to the file will fix the problem, however, MAKE SURE that none of your code is vulnerable to SQL injection attacks before you do this, as making this change could potentially allow someone to access local files on your server if you have any vulnerabilities in your queries. If you are using PHP, a good start would be making sure that all user entered data (GET, POST etc.) is run through the mysql_real_escape_string() function prior to being sent to MySQL. You have been warned!
This method assumes you have root access to the server. If not, you’ll need to speak nicely to your server admin
Find your my.cnf file. The exact location will depend on your OS/distribution. On Linux boxes it might be in /etc or /etc/mysql or something similar.
You will probably have a line in your my.cnf that says: set-variable=local-infile=0
Change it to: set-variable=local-infile=1
Restart MySQL.
You should now be up and running. It goes without saying that I am not responsible for anything untoward that happens on your server as a result of following these instructions.

Recent Comments