Archive for May 14th, 2009

Mysql Error: #42000 The used command is not allowed with this MySQL version

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.

1 Comment

About time I re-decorated here…

Well, as nice as the old look was, I got fed up with seeing it. I needed to upgrade my aging Wordpress installation and so I figured I would freshen up the look as well. All the same information is still here in all the same places, it just looks a bit more “2009″. Also, the Tradedoubler adverts which were making me look like a complete sell out, were in fact making me precisely £0! Complete waste of time. I do earn sensible money from contextual text link advertising and Google AdSense, so those are staying. I currently earn enough for a few tanks of fuel every month, which helps fund my motorcycling habit - who’d have thought you could make money from having the occasional rant?!

Hope you like it. And by “you” I mean the 16,000+ unique visitors that read my blog every month. Thanks!

I intend to provide more regular updates throughout the rest of 2009, including more technical info and information on a wider range of subjects.

Don’t forget you can follow my day-to-day adventures on Twitter - username: dayVboy. Enjoy!

No Comments