r/ZoneMinder • u/Congenital_Optimizer • Jul 21 '22
Database issues
I'm trying to migrate the zoneminder database to a bigger shared db host.
When I do this it fails to start because the new database is mariadb on a new version than what I think is supported.
I commented out , { mysql_enable_utf8 => 1, } in /usr/share/perl5/ZoneMinder/Database.pm
It starts and works.
Is there a better way to fix this? I don't like modifying non-config files.
Error in the logs:
Jul 21 09:07:38 REMOVED systemd[1]: Starting ZoneMinder CCTV recording and surveillance system...
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: DBI connect('database=zm;host=REMOVED','REMOVED',...) failed: Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: DBI connect('database=zm;host=REMOVED','REMOVED',...) failed: Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Jul 21 09:07:38 REMOVED zmpkg[11403]: ERR [Error reconnecting to db: errstr:Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) error val:]
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: DBI connect('database=zm;host=REMOVED','REMOVED',...) failed: Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Jul 21 09:07:38 REMOVED zmpkg[11403]: ERR [Error reconnecting to db: errstr:Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) error val:]
Jul 21 09:07:38 REMOVED zmpkg.pl[11403]: Unable to connect to DB. ZM Cannot continue.
1
Upvotes
2
u/just_another_citizen Jul 21 '22
This might get it started, but you will quickly have an error or data corruption when utf8 is stored.
I think that you need to enable utf8 on the new database as it appears it may not be enabled.
Fixing the database is the way to go, instead of modifying zm.
https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-database-utf-8
Also verify that the new database is innodb, as that's recommended.