This topic describes how to view the logs of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console. The logs include error logs, slow query logs, and primary/secondary switchover logs. You can use the logs to troubleshoot issues on the RDS instance.

For more information about how to view the logs of an RDS instance that runs a different database engine, see the following topics:

Procedure

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Logs.
  3. On the Logs page, click the Binlog Subscription, Error Logs, Slow Log Details, Slow Log Summary, or Primary/Secondary Switching Logs tab. Then, select a time range and click OK.
    Tab Description
    Binlog Subscription Allows you to subscribe to binary logs by using Data Transmission Service (DTS). For more information, see Purchase a DTS instance.
    Error Logs Provides statistics about the database running errors that occurred over the last 30 days.
    Slow Log Details Provides statistics about the SQL statements that each took more than 1 second to run over the last seven days. Duplicate SQL statements are removed. You can change the 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure the parameters of an ApsaraDB RDS for MySQL instance.
    Note This tab is refreshed once every minute.
    Slow Log Summary Provides analysis reports and statistics about the SQL statements that each took more than 1 second to run over the last seven days. You can change the 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure the parameters of an ApsaraDB RDS for MySQL instance.
    Primary/Secondary Switching Logs Provides statistics about the primary/secondary switchovers that occurred over the last 30 days. Primary/secondary switchover logs are supported only for RDS instances that do not run the RDS Basic Edition.
    Note If an RDS instance resides in the China (Zhangjiakou) region, ApsaraDB RDS retains only the error logs, slow query log details, and slow query log summary that are generated over the last nine days.