MySQL ‘present processlist’ assertion

MySQL ‘present processlist’ assertion


Linux Articles / All 94 Views comments

You can too get thread info from the INFORMATION_SCHEMA.PROCESSLIST desk or the mysqladmin processlist command. For those who should not have the PROCESS privilege, you possibly can view solely your personal threads. That's, you'll be able to view solely these threads related to the MySQL account that you're utilizing. If you don't use the FULL key phrase, solely the primary 100 characters of every assertion are proven within the Information area.

I'm on a check MySQL database and at present, no course of is operating on it. On a busy database, you'd see an extended record than proven under.

mysql show processlist statement

SHOW PROCESSLIST produces the next columns:

  • Id: Connection identifier
  • Consumer: MySQL consumer who issued the assertion
  • Host: Host identify of the shopper issuing the assertion
  • db: Default database chosen; in any other case NULL
  • Command: Sort of command that the thread is executing
  • Time: Time (in seconds) that the thread has been in its present state
  • State: Motion, occasion, or state indicating what the thread is doing
  • Information: Assertion that the thread is executing; in any other case NULL

The PROCESS privilege allows you to see all threads.

Utilizing the SHOW FULL PROCESSLIST assertion could be very helpful for those who get a “too many connections” error message and need to decide which statements are executing. MySQL reserves one additional connection for use by accounts which have the SUPER privilege. This ensures that even when the connection restrict has been reached, an administrator can all the time join and verify the system, assuming that software customers would not have the SUPER privilege.

mysql show full processlist

Use the KILL assertion to kill processes. If the method is operating in a terminal which you can entry, you possibly can kill it with the “CTRL + C” keyboard mixture, though that is much less clear than utilizing KILL.