Page 1 of 1

zoneminder multi server database questions

Posted: Mon Aug 28, 2023 2:20 pm
by lorenjz
I've been wanting to have a multi server setup for a while, the first time I attempted all of this think I went about it the wrong way. This time I have one machine running well, no errors and acting like it should with all of the cameras that I would like to start with. The big issue that I'm facing is with the database. Yesterday I had a second server configured successfully like the first. When I started the process to connect the second server to the first, it became apparent that the second server couldn't connect to the database. When I started to reread the wiki I noticed that I had missed the part about installing mariadb server software.



When I tried to install mariadb I received an error "Unable to correct problems, you have held broken packages." When I saw this error I started to dig back into the mysql config. Should mysql be able to accept incoming connections from another machine? I changed the file /etc/mysql/my.cnf to include the line bind-address = 0.0.0.0 After accomplishing this step I still wasn't able to connect.

I feel like getting mariadb up and running would be the way to go but wanted to check here before I messed anything up to terribly. Does anyone have any thoughts or suggestions?

Re: zoneminder multi server database questions

Posted: Mon Aug 28, 2023 3:59 pm
by Magic919
What have you done about the error?

Re: zoneminder multi server database questions

Posted: Mon Aug 28, 2023 4:26 pm
by iconnor
If you have a working zm server, then you already have a mysql server in place. The second server needs to be configured to point to it. You don't install a second mysql server. Edit /etc/zm/zm.conf on the second server and fill in teh db_host value appropriately. You may have to edit the config of the mysql server because by default it only listens on localhost.

Re: zoneminder multi server database questions

Posted: Mon Aug 28, 2023 4:34 pm
by lorenjz
  • I've double checked to make sure that I typed in the user correctly when adding in mysql on the first server by typing "SELECT USER, HOST FROM mysql.user;" and it shows that the user for the second machine is in the list.
  • I also checked to see if it had privilege for the database with "SHOW GRANTS FOR 'zmuser'@192.168.1.60 and it lists zm.* as one of the entries.
  • I've checked the logs to see if there were any entries to see if there were any entries listing a connection attempt or a reason to block that host
  • flushed privileges
  • restarted mysql service
  • Double checked the zm.conf file to ensure that ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS were all set correctly
did I miss something?

Re: zoneminder multi server database questions

Posted: Mon Aug 28, 2023 6:44 pm
by lorenjz
Apparently I had edited the wrong config file for mysql. It seems to be working now. Thanks for the help!

Re: zoneminder multi server database questions

Posted: Tue Aug 29, 2023 7:49 am
by liliana89
Try fixing any broken packages by running sudo apt --fix-broken install. This command will attempt to resolve any dependency issues automatically.
house of hazards