Page 1 of 1

Database doesn’t exist

Posted: Sun Mar 05, 2023 3:33 pm
by chuck8530
Beelink SER4, Ubuntu 22.04, Docker 20.10.23, Zoneminder 1.36.4

Every morning between 6 AM and 7AM Zoneminder attempts to do a DB something and is told the DB zm doesn’t exist. Mysql is up and running, show databases returns the other 4 mysql DB’s but not zm. So, I’ve created a cron job, every 5 min, “select count(*) cameras…” - if == 0 docker restart zoneminder.
Google has been no help. I:m at a loss. Suggestions please.

Re: Database doesn’t exist

Posted: Mon Mar 06, 2023 12:42 am
by burger
chuck8530 wrote: Sun Mar 05, 2023 3:33 pm Mysql is up and running, show databases returns the other 4 mysql DB’s but not zm.
But the database is accessible any time other than 6-7AM?

Re: Database doesn’t exist

Posted: Tue Mar 07, 2023 3:08 pm
by chuck8530
Everything runs fine until (my crontab check every 5 min) 6:25, 6:15, 6:40, 6:20 ... If it was the same time every day - but it's different every day 6:XX. "DB zm doesn't exist"

Re: Database doesn’t exist

Posted: Wed Mar 08, 2023 3:14 am
by burger
Just curious, What is the crontab check command you are running? This is an unusual use case, I'm just trying to understand what you are doing.

Re: Database doesn’t exist

Posted: Wed Mar 08, 2023 6:32 pm
by chuck8530
docker exec zoneminder bash /root/bin/ck.sql
runs: echo "select count(*) from Monitors;" | mysql -s zm

should return "7" but at 06:xx it returns "ERROR 1049 (42000): Unknown database 'zm' "

Re: Database doesn’t exist

Posted: Thu Mar 09, 2023 3:37 pm
by chuck8530
zmdc.log
03/09/23 06:11:56.490429 zmdc[14210].INF [ZMServer:411] ['zmc -m 7' started at 23/03/09 06:11:56]
03/09/23 06:11:56.544327 zmdc[463].ERR [ZMServer:708] ['zmc -m 7' exited abnormally, exit status 255]
03/09/23 06:13:16.623873 zmdc[463].INF [ZMServer:411] [Starting pending process, zmc -m 7]
03/09/23 06:13:16.625734 zmdc[463].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

Re: Database doesn’t exist

Posted: Thu Mar 09, 2023 8:43 pm
by dougmccrary
Wild guess here. Maybe something to do with DST, or lack thereof? IOW, some time discrepancy?
That's all that would seem to involve a single hour. Yeah, I realize it's erratic, but still...

Re: Database doesn’t exist

Posted: Fri Mar 10, 2023 9:20 am
by Magic919
What do the MySQL logs say?