What's causing [ERROR] Invalid (old?) table or database name 'd:q'?
The following day I got the same errors at exactly the same time (2am and 2:05am), so looked into it more.
The :q felt like a bit of a clue to me.  I couldn't really understand how I could have accidentally affected MariaDB when (failing) to quit vim... but I went looking in my /var/lib/mysql directory, and sure enough there was an empty directory d:q.  Deleted it and I'm assuming the problem will go away.