AnalyticDB for MySQL provides the SQL audit feature to log data manipulation language (DML) and data definition language (DDL) operations that are executed in databases in real time. You can retrieve database operation information from audit logs. This improves the security of cloud-native Data Warehouse AnalyticDB for MySQL Edition databases.

Pricing

The SQL audit feature is in public preview and can be used free of charge. After the public preview ends, AnalyticDB for MySQL reserves your audit logs from the last month for free. You are charged for the storage of the audit logs that are generated one month ago.

Features

  • SQL audit logging

    AnalyticDB for MySQL logs all operations that are performed on databases. You can use audit logs to identify faults, analyze database activities, and audit databases for security purposes.

  • Data search

    You can search data by combining multiple conditions, such as database, client IP address, execution duration, and execution status. You can also export search results.

Enable SQL audit

  1. Log on to the AnalyticDB for MySQL console by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, click the target Cluster ID.
  5. In the left-side navigation pane, click Data Security.
  6. On the Data Security page, click the SQL Audit tab.
  7. On the SQL Audit tab, click Enable SQL Audit in the upper-right corner.
  8. In the dialog box that appears, select Yes and click OK.
    1

Query and export SQL audit logs

  1. Log on to the AnalyticDB for MySQL console by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, click the target Cluster ID.
  5. In the left-side navigation pane, click Data Security.
  6. On the Data Security page, click the SQL Audit tab.
  7. On the SQL Audit tab, query SQL audit logs within a specific period of time based on Operation Type or Execution Status.
    Note
    • You can query SQL audit logs that are generated only within the last 15 days.
    • If you want to save SQL audit logs to your computer, click Export Current Page.

Disable SQL audit

Note After SQL audit is disabled, SQL audit logs are cleared. Query and export SQL audit logs before you disable SQL audit.
  1. Log on to the AnalyticDB for MySQL console by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, click the target Cluster ID.
  5. In the left-side navigation pane, click Data Security.
  6. On the Data Security page, click the SQL Audit tab.
  7. On the SQL Audit tab, click Audit Configuration in the upper-right corner.
  8. In the dialog box that appears, select No and click OK.
    3