0

I'm having problems using 'LOAD DATA INFILE' via a db.executesql() command: I'm getting "InternalError: (1148, u'The used command is not allowed with this MySQL version')"

A bit of digging, and I find I need to set --local-infile as a mysql option (MySQL: Enable LOAD DATA LOCAL INFILE). I've modified my.cnf, but that doesn't seem to be being picked up by web2py. How can I pass options to the mysql client which is used by web2py?

Community
  • 1
  • 1
user2667066
  • 1,867
  • 2
  • 19
  • 30
  • I should say that it works fine from the mysql command-line, once my.cnf is set to [mysql] local-infile – user2667066 Apr 15 '16 at 06:52
  • Thanks to http://stackoverflow.com/questions/36648700/web2py-pass-parameters-to-db-connection I can see how to set a my.cnf file using something like DAL(...,{driver_args={'read_default_file':"/usr/local/etc/my.cnf"}). And I can verify that I now get "((u'local_infile', u'ON'),)" from something like print(db.executesql("SHOW VARIABLES LIKE 'local_infile';")). But I *still* have the error logged in web2py 'The used command is not allowed with this MySQL version'. I'm baffled. – user2667066 Apr 15 '16 at 21:28

0 Answers0