Henrik, I would appreciate if you could look into this.  I put prosody and
the mysql driver on my production system with the same error.  The
production system is also the release version of openBSD 5.8 and the
additions came from packages. Do you have a test system on which you can
test this?  There is really nothing to configure to add mysql other than
adding the lua mysql package.


Error message from production system:

Feb 12 22:42:06 storagemanager  error   Failed to load storage driver plugin
sql on secure.gccinc.ca: /usr/local/share/lua/5.1/DBI.lua:52: Cannot load
driver MySQL. Available drivers are: SQLite3
stack traceback:

But the mysql package is there:

# ls -al /usr/local/lib/lua/5.1
total 392
drwxr-xr-x  5 root  wheel    512 Feb 12 20:25 .
drwxr-xr-x  3 root  wheel    512 Jan 14 22:32 ..
-r-xr-xr-x  1 root  bin    28966 Aug  7  2015 dbdmysql.so
-r-xr-xr-x  1 root  bin    18801 Aug  7  2015 dbdsqlite3.so
-r--r--r--  1 root  bin    18473 Aug  7  2015 lfs.so
drwxr-xr-x  2 root  wheel    512 Feb 12 20:22 luaevent
-r--r--r--  1 root  bin    39219 Aug  7  2015 lxp.so
drwxr-xr-x  2 root  wheel    512 Feb 12 20:22 mime
drwxr-xr-x  2 root  wheel    512 Feb 12 20:22 socket
-r--r--r--  1 root  bin    63197 Aug  7  2015 ssl.so
-r--r--r--  1 root  bin    13229 Aug  7  2015 zlib.so


-----Original Message-----
From: owner-po...@openbsd.org [mailto:owner-po...@openbsd.org] On Behalf Of
Stephen Graf
Sent: Friday, February 12, 2016 2:07 PM
To: ports@openbsd.org
Subject: FW: prosody with mysql clarification

Additional information:

The system is running openBSD 5.8 from the release.  It is a test system.
It did have wireshark and redis installed which brought in lua ver 5.2.  I
took all the lua packages pertaining to lua out and resinstalled just
prosody and the mysql and postgress drivers.

-----Original Message-----
From: Adam Wolk [mailto:adam.w...@tintagel.pl]
Sent: Friday, February 12, 2016 1:54 PM
To: Stephen Graf <s_g...@telus.net>
Subject: Re: prosody with mysql clarification

On Fri, 12 Feb 2016 13:02:56 -0800
"Stephen Graf" <s_g...@telus.net> wrote:

> Thank you for replying to my post.  I am sending this to you only as I 
> am not sure of the procedures on the ports mailing list.  I have used 
> openBSD for many years for bacula, samba and recently ownCloud and 
> have never resorted to the opwnBSD mailing lists for help.
> However I am wanting to install a jabber server and I first tried 
> jabberd until I realized the package is horribly out of date and not 
> maintained.  Prosody seems much better and cleaner.  The installation 
> of mysql seems simply enough, but it just does not seem to work and 
> there is very little on the web for help.
> 

Hi Stephen,
No need to worry about ports@. Your email was OK, people just asked for more
detail as it was hard to judge what the issue was exactly.

In short I think you should forward the details you provided here to the
ports@ mailing list. Additionally outlining if you are using -current or a
specific release (that's the only information missing here I think). I added
some more answers inline. Feel free to just forward this email or your
original reply with more details.

> If you have a few spare moments, I have listed what I have done.  If 
> you have a test system can you try mysql?  I added the postgress 
> driver on my test system and it seems to pick that up.
> 

Unfortunately my XMPP system is also my personal mail server additionally
running -current. I would need to upgrade to a newer snapshot before trying
any mysql ports and I would rather avoid service disruption at this point. I
could try in a VM if you indicate which OpenBSD version you are trying to
accomplish this with.

> I am trying to set up mysql and getting an error saying the DBI.lua 
> module cannot load the driver MYSQL.  I looked at the DBI.lua code and 
> it would seem that it should work.
> 
> Error message from log:
> 
> Feb 12 11:29:27 modulemanager   error   Error initializing module
> 'storage_sql' on 'xxx': /usr/local/share/lua/5.1/DBI.lua:52: Cannot 
> load driver MySQL. Available drivers are: SQLite3,PostgreSQL stack
> traceback:
> 

This really looks like it could be a valid bug, considering that your setup
properly detects postgresql. Note I asked if you did anything post
installing as your initial mail didn't indicate it.

> 
> From DBI.lua code:
> 
> -- Driver to module mapping
> local name_to_module = {
>     MySQL = 'dbdmysql',
>     PostgreSQL = 'dbdpostgresql',
>     SQLite3 = 'dbdsqlite3',
>     DB2 = 'dbddb2',
>     Oracle = 'dbdoracle',
> }
> 
> # ls -al /usr/local/lib/lua/5.1/
> total 440
> drwxr-xr-x  5 root  wheel    512 Feb 12 11:29 .
> drwxr-xr-x  3 root  wheel    512 Feb 12 11:10 ..
> -r-xr-xr-x  1 root  bin    28966 Aug  7  2015 dbdmysql.so
> -r-xr-xr-x  1 root  bin    22907 Aug  7  2015 dbdpostgresql.so
> -r-xr-xr-x  1 root  bin    18801 Aug  7  2015 dbdsqlite3.so
> -r--r--r--  1 root  bin    18473 Aug  7  2015 lfs.so
> drwxr-xr-x  2 root  wheel    512 Feb 12 11:11 luaevent
> -r--r--r--  1 root  bin    39219 Aug  7  2015 lxp.so
> drwxr-xr-x  2 root  wheel    512 Feb 12 11:11 mime
> drwxr-xr-x  2 root  wheel    512 Feb 12 11:11 socket
> -r--r--r--  1 root  bin    63197 Aug  7  2015 ssl.so
> -r--r--r--  1 root  bin    13229 Aug  7  2015 zlib.so
> 
> 
> Config:
> 
> storage = "sql" -- Default is "internal"
> 
> -- For the "sql" backend, you can uncomment *one* of the below to
> configure: --sql = { driver = "SQLite3", database = "prosody.sqlite" } 
> -- Default. 'database' is the filename.
> sql = { driver = "MySQL", database = "prosody", username = "prosody", 
> password = "secret", host = "localhost" } --sql = { driver = 
> "PostgreSQL", database = "prosody", username = "prosody", password = 
> "secret", host = "localhost" }
> 
> The database has been set up
> 
> # mysql -u prosody -p
> Enter password:
> Welcome to the MariaDB monitor.  Commands end with ; or \g.
> Your MariaDB connection id is 11
> Server version: 10.0.20-MariaDB-log OpenBSD port:
> mariadb-server-10.0.20p0v0
> 
> Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
> 
> Type 'help;' or '\h' for help. Type '\c' to clear the current input 
> statement.
> 
> MariaDB [(none)]> use prosody
> Database changed
> MariaDB [prosody]> show tables;
> Empty set (0.00 sec)
> 
> MariaDB [prosody]> exit;
> Bye
> 
> I tried a config with the postgress database and the error message 
> changes to show " Failed to connect to database: no connection to the 
> server" which makes sense as I do not have a postgress server.  It did 
> not complain about a missing driver.
> 

Yeah it really looks like a valid issue with the mysql driver.

> -----Original Message-----
> From: owner-po...@openbsd.org [mailto:owner-po...@openbsd.org] On 
> Behalf Of Adam Wolk
> Sent: Friday, February 12, 2016 10:02 AM
> To: ports@openbsd.org
> Subject: Re: prosody with mysql clarification
> 
> On Thu, 11 Feb 2016 22:18:08 -0800
> "Stephen Graf" <s_g...@telus.net> wrote:
> 
> > When I tried to set up prosody with sql storage using mysql I 
> > followed the instructions in the package and added luadbi-mysql.
> > However prosody did not seem to pick up on it even though the 
> > prosody documentation says that nothing more is required.  When I 
> > looked into what luadbi-mysql provided I discovered a c library, 
> > dbdmysql.so. How is this converted to a lua file that prosody can 
> > use?
> > 
> 
> What did you try after enabling the sql storage in prosody? Here are 
> the config changes I made (slightly redacted) to get prosody to use my 
> postgres database.
> 
> storage = "sql" -- Default is "internal"
> 
> -- For the "sql" backend, you can uncomment *one* of the below to
> configure: --sql = { driver = "SQLite3", database = "prosody.sqlite" } 
> -- Default. 'database' is the filename.
> --sql = { driver = "MySQL", database = "prosody", username = 
> "prosody", password = "secret", host = "localhost" } sql = { driver = 
> "PostgreSQL", database = "prosody", username = "prosody", password = 
> "secret", host = "localhost" }
> 
> Regards,
> Adam
> 

Reply via email to