If you enable the SQL audit function, all SQL operations will be logged, and you can download audit logs to view details. By default, the SQL audit function is disabled. Enabling this function may affect performance.
Alternatively, select an audit log and click Download in the Operation column to download an individual SQL audit log.
Parameter |
Description |
---|---|
record_id |
ID of a single audit log record. |
connection_id |
ID of the session executed by the record, which is the same as the ID in the show processlist command output. |
connection_status |
Session status, which is usually the returned error code of a statement. If a statement is successfully executed, the value 0 is returned. |
name |
Recorded type name. Generally, DML and DDL operations are QUERY, connection and disconnection operations are CONNECT and QUIT, respectively. |
timestamp |
Recorded UTC time. |
command_class |
SQL command type. The value is the parsed SQL type, for example, select or update. (This field does not exist if the connection is disconnected.) |
sqltext |
Executed SQL statement content. (This field does not exist if the audit connection is disconnected.) |
user |
Login account. |
host |
Login host. The value is localhost for local login and is empty for remote login. |
external_user |
External username. |
ip |
IP address of the remotely-connected client. The local IP address is empty. |
default_db |
Default database on which SQL statements are executed. |