I have a MySQL 8 server on a virtual machine. I’d like to start it up when another server wants to communicate with it, and shut it down some time after there hasn’t been any connections or queries.
Right now I’m polling the VM to get it somewhat working, but there’s gotta be a better way.
I read the MySQL docs on handling Unix signals, but there isn’t a “startup” type signal.
I also read about MySQL events, but those seem to be limited to operations within the database like SQL queries.
Does MySQL have a way to push events to a remote server on startup, shutdown, error, etc.?
It’s probably possible to achieve in a script on the OS, and then send a curl request to the remote server with appropriate info, but MySQL’s a big software and I’m curious if this functionality is hidden somewhere in it.