How to connet to Mysql from Lua with local-infile=1 -



How to connet to Mysql from Lua with local-infile=1 -

i connectig mysql database lua using :

mysql = require "luasql.mysql" local env = mysql.mysql() local conn = env:connect(database,username,password)

but alternative local-infile not activated requests using load info don't work. tried set line

local-infile = 1

in file my.cnf in field [client] still doesn't work. fyi : using linux , mysql 5.1.

thank in advance help

i went through same situation lastly week. query load info infile worked on mac osx, not create work on ubuntu. way found create work adding 1 line of code luasql project , recompiling it.

i used mysql driver's function mysql_options (you can check prototype in mysql.h file, located @ /usr/include/mysql) enable local-infile. can check code @ repository.

to compile , install workaround, should download files:

$ wget https://github.com/rafaeldias/luasql/archive/master.zip $ unzip master.zip

to compile , install :

$ cd luasql-master/ $ create $ sudo create install

note: depending on lua , mysql folders located, may need set proper values lua_libdir, lua_dir , lua_inc , driver_libs , driver_incs in config file within luasql folder.

hope helps.

mysql lua load-data-infile my.cnf luasql

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -