Help Center > > FAQs> General FAQs> How Do I View All SQL Logs Executed by MySQL?

How Do I View All SQL Logs Executed by MySQL?

Updated at: Mar 17, 2020 GMT+08:00

You can use the visualized database management service Data Admin Service (DAS) to quickly search for target SQL execution records. You can also use the SQL audit function of RDS to query all SQL operation records.

Querying SQL Logs Through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click Service List. Under Database, click RDS. The RDS console is displayed.
  4. On the Instance Management page, locate the target DB instance and click Log In in the Operation column.
  5. On the displayed login page, enter the correct username and password and click Log In.
  6. In the upper menu bar, choose SQL Operation > SQL History. The historical queries are displayed.
  7. On the displayed page, search for the target SQL by date range, database name, or keyword.

    • You can click a database name to access the Database Management page.
    • You can copy the SQL statement. Click the SQL statement and click Copy on the displayed page.
    • Click Open in SQL Window. You can directly execute the statement in the SQL window.

Querying SQL Logs Through RDS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click Service List. Under Database, click RDS. The RDS console is displayed.
  4. On the Instance Management page, click the target DB instance.
  5. In the navigation pane on the left, choose SQL Audits. On the displayed page, select a time range in the upper right corner, select SQL audit logs to be downloaded in the list, and click Download above the list to download SQL audit logs in batches.

    Alternatively, select an audit log and click Download in the Operation column to download one SQL audit log.

    Figure 1 Downloading SQL audit logs

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel