Failed to load Mysql driver

895 views
Skip to first unread message

manish patel

unread,
Oct 7, 2014, 4:44:32 AM10/7/14
to prosod...@googlegroups.com
I am using fedora 17 and have installed prosody and all the dependencies. But I am not able to find the reason for this error.

Prosody.log

Oct 07 14:06:45 general info    Hello and welcome to Prosody version hg:7e69d61a0ef7
Oct 07 14:06:45 general info    Prosody is using the select backend for connection handling
Oct 07 14:06:45 hostmanager     debug   Activated host: 192.168.105.142
Oct 07 14:06:45 modulemanager   error   Error initializing module 'storage_sql' on '192.168.105.142': /usr/local/share/lua/5.1/DBI.lua:53: Cannot load driver MySQL. Available drivers are: (None)
stack traceback
:
       
./core/modulemanager.lua:29: in function <./core/modulemanager.lua:29>
       
[C]: in function 'error'
       
/usr/local/share/lua/5.1/DBI.lua:53: in function 'Connect'
       
./plugins/mod_storage_sql.lua:68: in function 'connect'
       
./plugins/mod_storage_sql.lua:173: in main chunk
       
(tail call): ?
       
[C]: in function 'xpcall'
       
./core/modulemanager.lua:29: in function 'pcall'
       
./core/modulemanager.lua:171: in function 'do_load_module'
       
./core/modulemanager.lua:249: in function 'load'
       
./core/storagemanager.lua:54: in function 'load_driver'
       
...
       
./core/modulemanager.lua:171: in function 'do_load_module'
       
./core/modulemanager.lua:249: in function 'load'
       
./core/usermanager.lua:66: in function '?'
       
./util/events.lua:67: in function 'fire_event'
       
./core/hostmanager.lua:97: in function 'activate'
       
./core/hostmanager.lua:44: in function '?'
       
./util/events.lua:67: in function 'fire_event'
       
./prosody:331: in function 'prepare_to_start'
       
./prosody:397: in main chunk
       
[C]: ?
Oct 07 14:06:45 storagemanager  error   Failed to load storage driver plugin sql on 192.168.105.142: /usr/local/share/lua/5.1/DBI.lua:53: Cannot load driver MySQL. Available drivers are: (None)
stack traceback
:
       
./core/modulemanager.lua:29: in function <./core/modulemanager.lua:29>
       
[C]: in function 'error'
       
/usr/local/share/lua/5.1/DBI.lua:53: in function 'Connect'
       
./plugins/mod_storage_sql.lua:68: in function 'connect'
       
./plugins/mod_storage_sql.lua:173: in main chunk
       
(tail call): ?
       
[C]: in function 'xpcall'
       
./core/modulemanager.lua:29: in function 'pcall'
       
./core/modulemanager.lua:171: in function 'do_load_module'
       
./core/modulemanager.lua:249: in function 'load'
       
./core/storagemanager.lua:54: in function 'load_driver'
       
...
       
./core/modulemanager.lua:171: in function 'do_load_module'
       
./core/modulemanager.lua:249: in function 'load'
       
./core/usermanager.lua:66: in function '?'
       
./util/events.lua:67: in function 'fire_event'
       
./core/hostmanager.lua:97: in function 'activate'
       
./core/hostmanager.lua:44: in function '?'
       
./util/events.lua:67: in function 'fire_event'
       
./prosody:331: in function 'prepare_to_start'
       
./prosody:397: in main chunk
       
[C]: ?
Oct 07 14:06:45 storagemanager  warn    Falling back to null driver for accounts storage on 192.168.105.142


If i run a  normal program like the one below, i get no error

#!/usr/bin/lua

require "luasql.mysql"
env
= assert (luasql.mysql())
con
= assert (env:connect("prosody", "abcd","abcd", "127.0.0.1", 3306))
--for id, name, address in rows (con, "select * from contacts") do
--  print (string.format ("%s: %s", name, address))
--end


What is default port value used for mysql since we don't provide it in prosody.cfg.lua ?

Kim Alvefur

unread,
Oct 7, 2014, 6:07:05 AM10/7/14
to prosod...@googlegroups.com
Hi!

On 2014-10-07 10:44, manish patel wrote:
> I am using fedora 17 and have installed prosody and all the
> dependencies. But I am not able to find the reason for this error.
>
(snip)
> If i run a normal program like the one below, i get no error
> require"luasql.mysql"

That's LuaSQL. Prosody uses LuaDBI, so you'll need the MySQL driver for
that instead.

> What is default port value used for mysql since we don't provide it in
> prosody.cfg.lua ?

Looks like libmysqlclient will read it from my.cnf if it's not provided.
There's no default in either Prosody or LuaDBI.

--
Regards,
Kim "Zash" Alvefur

signature.asc

manish patel

unread,
Oct 8, 2014, 1:24:06 AM10/8/14
to prosod...@googlegroups.com
Hi sir,
Thank you for the reply. But I would like to state the problem again.It is I am not able to find the reason for " Cannot load driver MySQL " error. I have installed mysql and lua-dbi-mysql and all the dependencies but still I dont know why this error is coming. I have installed prosody on a Debian-Ubuntu system and connected it to my PC's mysql and its working smooth but frm mine its showing this error. 
How can i solve this issue ?

       
./core/<span style="color: #000;" cl
...

       
./core/<span style="color: #000;" cl
...

       
./core/<span style="color: #000;" cl
...

Daurnimator

unread,
Oct 8, 2014, 12:09:50 PM10/8/14
to prosod...@googlegroups.com
What do you get if you run:

 $ lua5.1 -e 'for _,v in ipairs(require"DBI".Drivers()) do print(v) end'

--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-user...@googlegroups.com.
To post to this group, send email to prosod...@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.

Ammar Bandukwala

unread,
Jan 12, 2017, 12:49:40 PM1/12/17
to Prosody IM Users
[root@vultr Luadbi]#  lua -e 'for _,v in ipairs(require"DBI".Drivers()) do print(v) end'

SQLite3
PostgreSQL
I've installed libdbi-dbd-mysql and no success.
Reply all
Reply to author
Forward
0 new messages