In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Show processlist and show full processlist
The output of the processlist command shows which threads are running, not only the current number of connections, but also the current connection status to help identify problematic query statements, and so on.
If it is a root account, you can see the current connection of all users. If it is another ordinary account, you can only see the connection occupied by yourself. Showprocesslist can only list the current 100 items. If you want to list it all, you can use the SHOW FULL PROCESSLIST command
Mysql > show processlist +-+-+ | Id | User | Host | db | Command | Time | State | Info | + +-+ | 1 | root | localhost | NULL | Sleep | 12 | NULL | | 2 | root | 192.168.100 . 1Plu7437 | test | Sleep | 8035 | NULL | 3 | root | 192.168.100.1 NULL 7438 | NULL | Sleep | 24348 | | NULL | 5 | root | 192.168.100.1 NULL 7443 | NULL | Sleep | 24317 | | NULL | 7 | root | 192.168.100.1Suzhou 7450 | test | Sleep | 24272 | NULL | | | 9 | root | 192.168.100.1 Query 5152 | test | Query | 0 | init | show processlist | +-+-- + 6 rows in setmysql > show full processlist | +-+-- + | Id | User | Host | db | Command | Time | State | Info | | +-+ | 1 | root | localhost | NULL | Sleep | 19 | | NULL | | | 2 | root | 192.168.100.1Sleep 7437 | test | Sleep | 8042 | NULL | 3 | root | 192.168.100.1Sleep 7438 | NULL | Sleep | 24355 | NULL | 5 | root | 192.168.100.1pur7443 | NULL | 24324 | NULL | 7 | root | 192.168.100. 1Plu7450 | test | Sleep | 24279 | | NULL | | 9 | root | 192.168.100.1 root | test | Query | 0 | init | show full processlist | +-+ -+ 6 rows in set
The meaning of each column:
① .id column, the "connection_id" assigned by the system when the user logs in to mysql, which can be viewed using the function connection_id ()
The ②. User column, which displays the current user. If it is not root, this command displays only sql statements within the scope of the user's permissions.
③ .host column, which shows which ip and which port the statement is sent from, and can be used to track the user who has the problem statement.
The ④ .db column showing which database the process is currently connected to
⑤ .command column, which shows the commands executed by the current connection. Generally, the values are sleep, query, connect, etc.
The ⑥ .time column, which shows the duration of this state in seconds
The ⑦. State column, which shows the status of the sql statement using the current connection, a very important column. State describes a state in the execution of a statement. A sql statement, taking a query as an example, may need to go through copying to tmp table, sorting result, sending data and other states before it can be completed
The ⑧. Info column, which displays this sql statement, is an important basis for judging problem statements.
"in a master-slave replication environment, show processlist or show full processlist is helpful in determining status, such as the following state column:"
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.