Zoneminder-notes: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 6: | Line 6: | ||
===== Rebuild database after Docker clobbers it ===== | ===== Rebuild database after Docker clobbers it ===== | ||
# | # Assuming docker is crashing, so nothing is using db | ||
# Copy database from /opt/Zoneminder/mysql /opt/mysql_backup (hopefully unneeded) | # Copy database from /opt/Zoneminder/mysql /opt/mysql_backup (hopefully unneeded) | ||
# mkdir /opt/mysql | # mkdir /opt/mysql |
Revision as of 09:31, 14 February 2022
Zoneminder configuration information specific to the alarm filtering can be found in the following areas..
Rebuild database after Docker clobbers it
- Assuming docker is crashing, so nothing is using db
- Copy database from /opt/Zoneminder/mysql /opt/mysql_backup (hopefully unneeded)
- mkdir /opt/mysql
- mysqldump -u zmuser -pzmpass zm >> /tmp/dump.sql
- /usr/bin/mysql_install_db --defaults-file=/etc/mysql/my.cnf (If you edited to point to /opt/mysql in config)
- mysql_install_db --user=mysql --datadir=/opt/mysql --basedir=/usr ----auth-root-authentication-method=socket
- Start local database: /etc/init.d/mysql start
- login to database:
- use mysql;
- create USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
- grant all privileges on zm.* to 'zmuser'@'localhost';
- flush privileges;
- create database zm;
- sudo mysql -u root -S /var/run/mysqld/mysqld.sock zm < /tmp/dump.sql
- stop database
- copy database back into /opt/Zoneminder/mysql
- chown back to correct usierid (will not match mysql)
- 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