Hello, your code line os.execute need full path to mysql file.
This is also common to happen on scripts in fbsd.
Change this:
os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- für MySQL51
to
os.execute('/usr/local/bin/mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- für MySQL51
it will work.
Good 2015 to all.
many edits.. -> rusty English.. eheh!
EDIT2:
You may also change:
os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- für MySQL51
--os.execute('/usr/local/bin/mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55
to
--os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- für MySQL51
os.execute('/usr/local/bin/mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55
If you're using mysql 5.5...