[luatex] MySQL driver not found from inside LuaLaTeX
sergei.naumov at gmail.com
sergei.naumov at gmail.com
Wed Feb 28 21:15:25 CET 2024
What is also kind of strange is that if I do
\usepackage{luapackageloader}
\luadirect{
local DBI = require("DBI")
}
it does not yell at me, sit supposedly finds the module DBI where all other
functions live. But if I add a line
\usepackage{luapackageloader}
\luadirect{
local DBI = require("DBI")
local dbh = assert(DBI.Connect("MySQL","serge", "serge", "serge",
"localhost", 3306))
}
it says it can not find MySQL. How come if mysql.so is in the path?
Lua 5.3.6 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> package.path
/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua;./?.lua;./?/init.lua
> package.cpath
/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so
ср, 28 февр. 2024 г. в 22:59, <sergei.naumov at gmail.com>:
> 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
>
--
Thanks,
Sergei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20240228/b6468df7/attachment-0001.htm>
More information about the luatex
mailing list.