Help Center/ TaurusDB/ FAQs/ Database Connections/ How Do I Check the Connections to a GaussDB(for MySQL) Instance?
Updated on 2024-09-05 GMT+08:00

How Do I Check the Connections to a GaussDB(for MySQL) Instance?

Use either of the following methods:

  • Log in to the instance as user root and run the following command to view the threads running on it:

    show full processlist;

    Figure 1 Viewing threads

    • Id: Thread ID. You can use kill id to terminate a thread.
    • User: User used for connecting to the instance.
    • Host: IP address and port of the host that connects to the instance.
    • db: Database name.
    • Command: Connection status, which is usually Sleep, Query, or Connect.
    • Time: Connection duration, in seconds.
    • State: Status of the SQL statement being executed.
    • Info: SQL statement that is being executed.
    • CPU_time: Amount of time for which the current connection has been established.
  • On the Instances page, locate the instance and click View Metrics in the Operation column.
    Figure 2 Viewing metrics

    View Total Connections. Generally, a primary/standby instance occupies two connections. If there are more than two connections, the instance is being connected and used by other users.

    Figure 3 Viewing total connections