问题
Mysql error logs only have a number next to them and the time they were created, I need to format it so that it also includes the date,
how should I do it?
130207 2:25:29 [Note] Plugin 'FEDERATED' is disabled.
130207 2:25:29 InnoDB: The InnoDB memory heap is disabled
130207 2:25:29 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
130207 2:25:29 InnoDB: Compressed tables use zlib 1.2.3
130207 2:25:29 InnoDB: Using Linux native AIO
130207 2:25:30 InnoDB: Initializing buffer pool, size = 3.0G
130207 2:25:30 InnoDB: Completed initialization of buffer pool
130207 2:25:30 InnoDB: highest supported file format is Barracuda.
130207 2:25:30 InnoDB: Waiting for the background threads to start
回答1:
Isn't 130207 the 7th of February 2013 ?
回答2:
@mimipc is correct, those first 6 characters are indeed YYMMDD.
A change was introduced beginning in MySQL 5.6.9:
mysqld now writes dates to the error log in ISO (YYYY-MM-DD hh:mm:ss) format. It also includes its process ID following the date.
I would not expect this to be back-ported into previous versions... but there's a patch attached to Bug #56240 that you could probably use on earlier versions if you were really motivated... however, MySQL 5.6 is now officially in General Availability status with MySQL 5.6.10.
来源:https://stackoverflow.com/questions/14758904/how-to-add-date-to-mysql-error-log