Zoneminder-notes

From I Will Fear No Evil
Revision as of 10:31, 14 February 2022 by Chubbard (talk | contribs)
Jump to navigation Jump to search

Zoneminder configuration information specific to the alarm filtering can be found in the following areas..

Rebuild database after Docker clobbers it
  1. Assuming docker is crashing, so nothing is using db
  2. Copy database from /opt/Zoneminder/mysql /opt/mysql_backup (hopefully unneeded)
  3. mkdir /opt/mysql
  4. mysqldump -u zmuser -pzmpass zm >> /tmp/dump.sql
  5. /usr/bin/mysql_install_db --defaults-file=/etc/mysql/my.cnf (If you edited to point to /opt/mysql in config)
    1. mysql_install_db --user=mysql --datadir=/opt/mysql --basedir=/usr ----auth-root-authentication-method=socket
  6. Start local database: /etc/init.d/mysql start
  7. login to database:
    1. use mysql;
    2. create USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
    3. grant all privileges on zm.* to 'zmuser'@'localhost';
    4. flush privileges;
    5. create database zm;
  8. sudo mysql -u root -S /var/run/mysqld/mysqld.sock zm < /tmp/dump.sql
  9. stop database
  10. copy database back into /opt/Zoneminder/mysql
  11. chown back to correct usierid (will not match mysql)
  12. Start docker container (sudo docker start Zoneminder)

Make damn sure that you lock down the docker version

apt-mark showhold
docker-ce
docker-ce-cli
docker-ce-rootless-extras
docker-scan-plugin