Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DBD-MariaDB after DBD-mysql dropped support of the MariaDB #3887

Open
VVD opened this issue Mar 23, 2024 · 5 comments
Open

Comments

@VVD
Copy link

VVD commented Mar 23, 2024

Describe Your Environment

  • Version of ZoneMinder: 1.36.33
  • How you installed ZoneMinder: build from ports
  • Full name and version of OS: FreeBSD 13.3 amd64
  • Browser name and version (if this is an issue with the web interface)

If the issue concerns a camera

  • Make and Model
  • frame rate
  • resolution
  • ZoneMinder Source Type:

Describe the bug
A clear and concise description of what the bug is.
DBD-mysql dropped support of the MySQL 5.7 and MariaDB: perl5-dbi/DBD-mysql#405 (comment)
If use MariaDB then can't use Zoneminder with recent DBD-mysql.
If install https://github.com/perl5-dbi/DBD-MariaDB instead of DBD-mysql then Zoneminder can't run.

To Reproduce
Steps to reproduce the behavior:

  1. Replace DBD-mysql with DBD-MariaDB.
  2. Start Zoneminder.
  3. Zoneminder can't run.

Expected behavior
Run and work without errors with DBD-MariaDB.
Article "Migrating from DBD::mysql to DBD::MariaDB":
https://blogs.perl.org/users/grinnz/2023/12/migrating-from-dbdmysql-to-dbdmariadb.html

Debug Logs

Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
03/23/24 03:47:34.518328 zmpkg[25250].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 10) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
03/23/24 03:47:34.518977 zmpkg[25250].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 9) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
03/23/24 03:47:34.519803 zmpkg[25250].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 11) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder/Config.pm line 150.
Compilation failed in require at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 33.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 34.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 34.
Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
03/23/24 03:47:34.644731 zmpkg[25255].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 10) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
03/23/24 03:47:34.645274 zmpkg[25255].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 9) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 114.
03/23/24 03:47:34.645874 zmpkg[25255].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr: error val:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.36 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.36/mach /usr/local/lib/perl5/5.36) at (eval 11) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.]
Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder/Config.pm line 150.
Compilation failed in require at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 33.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 34.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 34.
Copy link

welcome bot commented Mar 23, 2024

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

@connortechnology
Copy link
Member

@abishai Thoughts?

@abishai
Copy link
Contributor

abishai commented Mar 28, 2024

I'd say it needs testing. :p While the PR solves the problem with DBD-mysql, the more interesting question is it possible to build ZM with MariaDB client libraries.

But probably, this is not an issue as many Linux distros switched to MariaDB long time ago? I have MariaDB server, but clients are linked against mysql client.

But this PR will help a lot. I thought it won't be so easy to implement. Thanks!

@connortechnology
Copy link
Member

ubuntu 2310 here does not package dbd-mariadb. Debian bookworm does. So it's not universal yet. This change is needed for postgresql support as well.

@VVD
Copy link
Author

VVD commented Mar 28, 2024

Zoneminder build fine with mariadb-client. But it can't run with p5-DBD-MariaDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants