gpt4 book ai didi

MySql 输出格式

转载 作者:行者123 更新时间:2023-11-29 17:01:12 24 4
gpt4 key购买 nike

我试图了解 MySql 守护进程在运行时发送到控制台的输出格式。我正在寻找有关守护进程写入控制台的格式的文档,以解析它并确定其当前状态,但如果找到与此相关的注释。

示例:

2018-09-08T19:58:11.765549Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.

输出的某些部分是不言自明的。格式看起来像:[DATE]空间[?]空间[LogLevel]空间[?]空间[服务器]空间[消息]

有人可以链接此格式的文档或解释缺少的部分吗?另一个问题是消息是否可以包含换行符,并且日志行开头的日期是否取决于区域性或始终YYYY-MM-ddThh:mm:ss:fffZ? (对于解析很重要)。

谢谢。

最佳答案

嗯,看到这个问题后我打开了 mysql 的文档来查找相关详细信息:

man mysql

虽然我没有得到确切的答案,但这里已经足够接近了。在MYSQL LOGGING下,文档说明了存储为日志的参数。

这里直接来自文档:

   Logging occurs at the “information” level. This corresponds to the
LOG_INFO priority for syslog on Unix/Linux syslog capability and to
EVENTLOG_INFORMATION_TYPE for the Windows Event Log. Consult your
system documentation for configuration of your logging capability.

Message size is limited to 1024 bytes.

Messages consist of the identifier MysqlClient followed by these
values:

· SYSTEM_USER

The system user name (login name) or -- if the user is unknown.

· MYSQL_USER

The MySQL user name (specified with the --user option) or -- if the
user is unknown.

· CONNECTION_ID:

The client connection identifier. This is the same as the
CONNECTION_ID() function value within the session.

· DB_SERVER

The server host or -- if the host is unknown.

· DB

The default database or -- if no database has been selected.

· QUERY

The text of the logged statement.

这是一个日志示例(需要注意的是,每个日志条目占 1 行,与控制台上的输出非常相似)。结构看起来也很相似:

   Here is a sample of output generated on Linux by using --syslog. This
output is formatted for readability; each logged message actually takes
a single line.

Mar 7 12:39:25 myhost MysqlClient[20824]:
SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
DB_SERVER:'127.0.0.1', DB:'--', QUERY:'USE test;'
Mar 7 12:39:28 myhost MysqlClient[20824]:
SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
DB_SERVER:'127.0.0.1', DB:'test', QUERY:'SHOW TABLES;'

关于MySql 输出格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52239475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com