I am investigating an issue in an environment where MySQL is often restarted, by various actors (backups admins etc).
To make analysis saner, I need to know exactly when MySQL is (re)started.
Here is the current slow.log:
/usr/sbin/mysqld, Version: 5.5.27-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock
Time Id Command Argument
/usr/sbin/mysqld, Version: 5.5.27-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock
Time Id Command Argument
/usr/sbin/mysqld, Version: 5.5.27-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock
Time Id Command Argument
As you can see, there is no timestamp, I can only know that MySQL has been started 3 times that day, but I don't know when.
Question: How to make MySQL print a timestamp at each time it starts?
For unfortunate real-world reasons I can't get every single actor to reliably keep track of when they restart MySQL.