Open vomus opened 4 months ago
You are probably missing the MySQL driver. Drivers are typically seperate packages not included with the core DBI module. Look for something like luadbi-mysql, luadbi-dbd-mysql, dbd-mysql or similiar in your package manager.
Those are in place in /usr/lib64/lua/5.3/dbd/
[serge@yarilo 5.3]$ pwd
/usr/lib64/lua/5.3
[serge@yarilo 5.3]$ ls dbd/
total 72
24 mysql.so 24 postgresql.so 24 sqlite3.so
[serge@yarilo 5.3]$
I can also see that kpsewhich can find it
[serge@yarilo 5.3]$ kpsewhich mysql.so
/usr/lib64/lua/5.3/dbd/mysql.so
[serge@yarilo 5.3]$ kpsewhich DBI.lua
/usr/share/lua/5.3/DBI.lua
[serge@yarilo 5.3]$
How is that possible?
I looked what the correct cpath is
[serge@veles latex]$ lua5.3
Lua 5.3.6 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> package.cpath
/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so
>
changed the code and explicitly told where to look for the drivers:
\directlua{
package.cpath = "/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so"
print(package.cpath)
local DBI = require('DBI')
local dbh = assert(DBI.Connect("MySQL","serge", "serge", "serge", "localhost", 3306))
}
it shows the correct paths all right but still can not load the driver:
(/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd)package.cpath: /usr/lib64/lua/5.3/?;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so
./DBI.lua:53: Cannot load drive
r MySQL. Available drivers are: (None)
stack traceback:
[C]: in function 'error'
./DBI.lua:53: in function 'DBI.Connect'
[\directlua]:1: in main chunk.
l.10 }
Possibly some other error is occuring and being masked by DBI.lua. From inside Latex, try "require 'dbd.mysql'"
Hi! I just don't seem to be able to get DBI to work from lualatex although it works fine from a plain lua script. This is what I get on the console:
when there are only two lines of code:
Lualatex stop yelling when I leave only the first line where it just requires DBI, so it seems there is something in DBI.lua it does not like. And that means there is something wrong with function available_drivers()...