Download MySQL Utilities - Oracle Documentation

Transcript
mysql.utilities.parser — Parse MySQL Log Files
>>> slow_log = open("/var/lib/mysql/mysql-slow.log")
>>> log = SlowQueryLog(slow_log)
>>> for entry in log:
...
print entry
Parameters:
• stream (file type) – a valid file type; for example, the result of the built-in Python
function open()
version
Returns:
Version of the MySQL server that produced the log
Return type:
tuple
program
Returns:
Full path of the MySQL server executable
Return type:
str
port
Returns:
TCP/IP port on which the MySQL server was listening
Return type:
int
socket
Returns:
Full path of the MySQL server Unix socket
Return type:
str
start_datetime
Returns:
Date and time of the first read log entry
Return type:
datetime.datetime
lastseen_datetime
Returns:
Date and time of the last read log entry
Return type:
datetime.datetime
230