Help Center/ Relational Database Service/ FAQs/ Log Management/ How Do I View Logs of All SQL Statements Executed by My RDS for MySQL Instance?
Updated on 2024-10-22 GMT+08:00

How Do I View Logs of All SQL Statements Executed by My RDS for MySQL Instance?

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

Querying SQL Logs Through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances 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. On the top menu bar, choose SQL Operations > SQL History.
  7. On the displayed page, search for execution information about the target SQL statement by time range, database name, or keyword.

    Figure 1 SQL history
    • To access the Database Management page, click a database name.
    • To copy a SQL statement, click it in the SQL Statement column.
    • To execute a SQL statement, click Open in SQL window in the Operation column.