In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the method of viewing the mysql process, which has a certain reference value, friends who need can refer to it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
There are two ways to view mysql processes
1. Enter mysqladmin processlist under the mysql/bin directory
two。 Start mysql and enter show processlist
If you have SUPER permission, you can see all the threads; otherwise, you can only see the threads that you initiated (that is, the threads running under the corresponding MySQL account).
Mysql > show processlist +-+ | Id | User | Host | db | Command | Time | State | Info | +- -+-+ | 19161 | test_user | 171.8.216.253 Sleep 63583 | tbkttest | Sleep | | NULL | | 19164 | test_ User | 171.8.216.253 user 63677 | tbkttest | Sleep | 297 | | NULL | | 19165 | root | localhost | tbkttest | Query | 0 | NULL | show processlist | | 19166 | root | localhost | Sleep | 36 | NULL | + -+ 4 rows in set (0.00 sec)
First, let's briefly talk about the meaning and purpose of each column.
The first column id, needless to say, a logo, it is very useful when you want to kill a statement.
The second column, user, shows the single user. If it is not root, this command only shows the sql statements within your permissions.
The third column, the host column, shows which port the statement is issued from which ip. Can be used to track the user with the problem statement.
The fourth column, db, shows which database the process is currently connected to.
The fifth column, command, shows the commands executed by the current connection, which are generally sleep, query, and connect.
The sixth column time column, the duration of this state, in seconds.
The seventh column, state column, shows the status of the sql statement using the current connection. Very important columns, there will be descriptions of all the states later. Please note that state is only a state in the execution of the statement, a sql statement, which has been queried as an example, and may need to be completed through states such as copying to tmp table,Sorting result,Sending data.
The eighth column info shows the sql statement. Because of the limited length, the long sql statement is not fully displayed, but it is an important basis for judging the problem statement.
There are descriptions of all states in the mysql manual, and the link is as follows: http://dev.mysql.com/doc/refman/5.0/en/general-thread-states.html
Kill process
Kill id thank you for reading this article carefully. I hope the editor will share the methods and contents of viewing the mysql process to help everyone. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!
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.