Error reconnecting to db

Running Ubuntu/Zoneminder - everything runs fine after a few hours I get:

zmdc[463].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Unknown database ‘zm’ error val:

mysql is running and show databases doesn’t show zm. /etc/init.d/mysql restart doesn’t fix it. I have to sudo docker stop zoneminder then start. Google hasn’t been any help.

Thanks