I had a similar (timing??) problem a few months ago and ended-up creating a simple 'keep alive' flow.
I just do a SELECT query every 15-minutes. There have been some updates (one just over a week ago) to node-red-node-mysql since I wrote the code, so I don't know if my workaround is still needed.