[luatex] MySQL driver not found from inside LuaLaTeX

sergei.naumov at gmail.com sergei.naumov at gmail.com
Wed Feb 28 20:59:48 CET 2024


Thanks, Andreas!
It's still a bit unclear. I went to my /usr/share/texmf-local (because
adding lines into texmf-dist/web2c/texmf.cnf is bad) and created texmf.cfg
with the following

LUAINPUTS = $LUAINPUTS;/usr/share/lua/5.3//
CLUAINPUTS = $CLUAINPUTS:/usr/lib64/lua/5.3//

and ran mktexlsr, so it updates the search database.

[root at veles texmf-local]# mktexlsr
mktexlsr: Updating /etc/texmf/ls-R...
mktexlsr: Updating /usr/share/texmf-dist/ls-R...
mktexlsr: Updating /usr/share/texmf-local/ls-R...
mktexlsr: Updating /var/lib/texmf/ls-R...
mktexlsr: Done.

Then you mention luapackageloader in the context of a Lua syntax, so it
looks like it is a Luarocks package. But there is no such package. There is
a LaTeX package with this name just as Faheem mentions. So, I added
\usepackage{luapackageloader} which from its documentation suggests that it
adds necessary search paths:

\usepackage{luacode}
\usepackage{luatextra}
\usepackage{luapackageloader}

\luadirect{dofile("dbd.lua")}
\newcommand{\projectsfromdb}{\luadirect{projects_from_db()}}

I ran lualatex again but it still can't find MySQL driver. What didn't I
still do? :-)



ср, 28 февр. 2024 г. в 18:56, Andreas Matthias <andreas.matthias at gmail.com>:

> <sergei.naumov at gmail.com> wrote:
> >
> > I tried to set a few environment variables:
> >
> > LUAROCKS_CPATH=/usr/lib64/lua/5.3
> > LUAROCKS_PATH=/usr/share/lua/5.3
>
> Setting environment variables doesn't work. First you have to set the
> variables LUAINPUTS and CLUAINPUTS
> in your texmf.cnf. Then you need luapackageloader to set the search
> path correctly.
>
> local loader = require('luapackageloader')
> loader.add_lua_searchers()
>
> If you are running texlua you have to set the program name correctly:
>
> kpse.set_program_name('lualatex')
>
> There was a discussion some time ago:
> https://tug.org/pipermail/luatex/2021-March/007494.html
>
> Andreas
>


-- 
Thanks,
Sergei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20240228/bca1a08f/attachment.htm>


More information about the luatex mailing list.