格式化MySQL查询日志日期

时间:2016-05-09 20:48:36

标签: mysql date

我已启用MySQL查询记录

general_log_file = "C:/mysql/logs/queries.log"
log-bin = "C:/mysql/logs"
general_log_file = "C:/mysql/logs/queries.log"
log-warnings = 1
general-log

然而,日期格式不利于快速视觉解释:

160509 16:27:33 1871 Connect db@localhost on db_name
160509 16:27:36 1872 Connect db@localhost on db_name

如何在MySQL查询日志中格式化日期戳?

例如:

2016-05-09 16:27:33 1871 Connect db@localhost on db_name
2016-05-09 16:27:36 1872 Connect db@localhost on db_name

1 个答案:

答案 0 :(得分:1)

MySQL版本5.6.9将日志格式从YYMMDD更改为YYYY-MM-DD。看起来您的选择是升级。