I have the same issue after install the Zoneminder plugin on my TrueNAS Core-13.0-U3.1, then I start to debug this issue and found that zoneminder didn't install on the Jail created, so we need to install it manually.
Here is the steps:
1. Remember the database password from POST INSTALL NOTES
2. Go to Jails => zoneminder(you may use different jail name) => SHELL
3. run command: pkg install zoneminder
4. run command: mysql -u dbadmin -p zm < /usr/local/share/zoneminder/db/zm_create.sql
5. input the password from POST INSTALL NOTES, then wait it finish.
6. run command: touch /usr/local/etc/zoneminder/zm-freenas.conf
use vi to edit /usr/local/etc/zoneminder/zm-freenas.conf and add those lines
ZM_DB_NAME=zm
ZM_DB_USER=dbadmin
ZM_DB_PASS=(password from POST INSTALL NOTES)
7. service zoneminder start
Now we can go to the admin portal and start to use Zoneminder.
Hope this can help someone want to use Zoneminder on TrueNAS Core.
Thank you, it worked for me, but only on the first start.
If I restart the jail I get an error :
"Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm
SQLSTATE[HY000] [2002] No such file or directory"
on the shell, if i start manually the service, I have this detail
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002095 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
04/02/23 16:59:25.002273 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002431 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
Unable to connect to DB. ZM Cannot continue.
Any idea to solve the problem ?