2. show status 1e}wDMU(
]g:VvTJ;?
Aborted_clients ÓÉÓÚ¿Í»§Ã»ÓÐÕýÈ·¹Ø±ÕÁ¬½ÓÒѾËÀµô£¬ÒѾ·ÅÆúµÄÁ¬½ÓÊýÁ¿¡£ _Ab|<!a/R
Aborted_connects ³¢ÊÔÒѾʧ°ÜµÄMySQL·þÎñÆ÷µÄÁ¬½ÓµÄ´ÎÊý¡£ :}Z+K*%o-
Connections ÊÔͼÁ¬½ÓMySQL·þÎñÆ÷µÄ´ÎÊý¡£ 8NpQ"0X
Created_tmp_tables µ±Ö´ÐÐÓï¾äʱ£¬ÒѾ±»´´ÔìÁ˵ÄÒþº¬ÁÙʱ±íµÄÊýÁ¿¡£ *C$
W^u5h
Delayed_insert_threads ÕýÔÚʹÓõÄÑÓ³Ù²åÈë´¦ÀíÆ÷Ï̵߳ÄÊýÁ¿¡£ 9'}m797I'
Delayed_writes ÓÃINSERT DELAYEDдÈëµÄÐÐÊý¡£ y6$5meh.T
Delayed_errors ÓÃINSERT DELAYEDдÈëµÄ·¢ÉúijЩ´íÎó(¿ÉÄÜÖظ´¼üÖµ)µÄÐÐÊý¡£ [N{Rd[{QTL
Flush_commands Ö´ÐÐFLUSHÃüÁîµÄ´ÎÊý¡£ kYx|`-PA<r
Handler_delete ÇëÇó´ÓÒ»ÕűíÖÐɾ³ýÐеĴÎÊý¡£ euQd
Handler_read_first ÇëÇó¶ÁÈë±íÖеÚÒ»ÐеĴÎÊý¡£ !uHX2B+~
Handler_read_key ÇëÇóÊý×Ö»ùÓÚ¼ü¶ÁÐС£ QH;1*
Handler_read_next ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¼üµÄÒ»ÐеĴÎÊý¡£ [5>0om5
Handler_read_rnd ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¹Ì¶¨Î»ÖõÄÒ»ÐеĴÎÊý¡£ nXXyX[c4e
Handler_update ÇëÇó¸üбíÖÐÒ»ÐеĴÎÊý¡£ \=1k29O
Handler_write ÇëÇóÏò±íÖвåÈëÒ»ÐеĴÎÊý¡£ #VtlXr>G
Key_blocks_used ÓÃÓڹؼü×Ö»º´æµÄ¿éµÄÊýÁ¿¡£
R:-^,/1
Key_read_requests ÇëÇó´Ó»º´æ¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ D}Z].c@E
Key_reads ´Ó´ÅÅÌÎïÀí¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ UfXqcyY(
Key_write_requests ÇëÇó½«Ò»¸ö¹Ø¼ü×Ö¿éдÈ뻺´æ´ÎÊý¡£ g?)9zJ9
Key_writes ½«Ò»¸ö¼üÖµ¿éÎïÀíдÈë´ÅÅ̵ĴÎÊý¡£ c1Xt$[_
Max_used_connections ͬʱʹÓõÄÁ¬½ÓµÄ×î´óÊýÄ¿¡£ 5_#wOz0u$
Not_flushed_key_blocks ÔÚ¼ü»º´æÖÐÒѾ¸Ä±äµ«ÊÇ»¹Ã»±»Çå¿Õµ½´ÅÅÌÉϵļü¿é¡£ l\JoWL
Not_flushed_delayed_rows ÔÚINSERT DELAY¶ÓÁÐÖеȴýдÈëµÄÐеÄÊýÁ¿¡£ u+kXJ
Open_tables ´ò¿ª±íµÄÊýÁ¿¡£ O$<kWSC
Open_files ´ò¿ªÎļþµÄÊýÁ¿¡£ vA*!82
Open_streams ´ò¿ªÁ÷µÄÊýÁ¿(Ö÷ÒªÓÃÓÚÈÕÖ¾¼ÇÔØ£© ,_D`0B6o
Opened_tables ÒѾ´ò¿ªµÄ±íµÄÊýÁ¿¡£ n'K,*
Questions ·¢Íù·þÎñÆ÷µÄ²éѯµÄÊýÁ¿¡£ \IQf|
Slow_queries Òª»¨³¬¹ýlong_query_timeʱ¼äµÄ²éѯÊýÁ¿¡£ +' QX`
Threads_connected µ±Ç°´ò¿ªµÄÁ¬½ÓµÄÊýÁ¿¡£ /z.Y<xOc
Threads_running ²»ÔÚ˯ÃßµÄÏß³ÌÊýÁ¿¡£ 5(]=?$$*t
Uptime ·þÎñÆ÷¹¤×÷Á˶àÉÙÃë¡£ nn5tOV}QE
_8v8qT}O~4
After create IQAV`~_G
4"nb>tA
This occurs when the thread creates a table (including internal temporary tables), at the end of the function that creates the table. This state is used even if the table could not be created due to some error. )v
!GiZ"7
MqDz cB]
Analyzing 0JN>w^
R*|y:T,H
The thread is calculating a MyISAM table key distributions (for example, for ANALYZE TABLE). [H<![Z1*r
bFD
vCF
checking permissions Wn6~x2 LaV
094~ s
The thread is checking whether the server has the required privileges to execute the statement. iI\bD
wFI2(cQ
Checking table s\O4D*8
ldk (zAB.
The thread is performing a table check operation. B?n
6o|8
@D1}).
cleaning up %EV\nwn6
oHh~!#u
The thread has processed one command and is preparing to free memory and reset certain state variables. {&7%wZ"t_
KTLq~Ru
closing tables \"k[y+O],4
v<0\+}T1R
The thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, you should verify that you do not have a full disk and that the disk is not in very heavy use. 4gD;X NrV
E3hql3=
converting HEAP to MyISAM [Ey[A|g
: ;l9to
The thread is converting an internal temporary table from a MEMORY table to an on-disk MyISAM table. ~V34j:
@~p;.=1]F
copy to tmp table g}@W9'!
bqPaXH
n
The thread is processing an ALTER TABLE statement. This state occurs after the table with the new structure has been created but before rows are copied into it. fI<|]c}P&J
"%zb>`1s
Copying to group table };{Qx
eeMeV>
If a statement has different ORDER BY and GROUP BY criteria, the rows are sorted by group and copied to a temporary table. TKH!,Ow9A
Nh^
lC
Copying to tmp table [[XbKg`"?
pLdZB9oD]C
The server is copying to a temporary table in memory. aw\0\'}
cM?i _m
Copying to tmp table on disk / biB*Z
?y/LMja
The server is copying to a temporary table on disk. The temporary result set was larger than tmp_table_size and the thread is changing the temporary table from in-memory to disk-based format to save memory. j1~'[
b'O>qQ
Creating index sx^0*h-Qq
dbsD\\,2%N
The thread is processing ALTER TABLE ... ENABLE KEYS for a MyISAM table. ."u
DM<
o4t6NDa
Creating sort index ^[g7B"`K5
HU1ZQkf
The thread is processing a SELECT that is resolved using an internal temporary table. A(@VjXl
($T"m-e
creating table MhL>6rn
eqQ=HT7J
The thread is creating a table. This includes creation of temporary tables. Qq{>]5<
GwM(E^AG
Creating tmp table 7^FJ+gN8b
Ad)::9K?J
The thread is creating a temporary table in memory or on disk. If the table is created in memory but later is converted to an on-disk table, the state during that operation will be Copying to tmp table on disk. Wi2Tg^
=im7RgIBo
deleting from main table :cA%lKg
~\khwNA
The server is executing the first part of a multiple-table delete. It is deleting only from the first table, and saving columns and offsets to be used for deleting from the other (reference) tables. UAEu.AT
d1BE;9*/7
deleting from reference tables "pMx(
QzilivJf
The server is executing the second part of a multiple-table delete and deleting the matched rows from the other tables. /Bs42uJ3
[]l2
`fS#
discard_or_import_tablespace =;(y5c
>_|$7m.?n[
The thread is processing an ALTER TABLE ... DISCARD TABLEspaCE or ALTER TABLE ... IMPORT TABLEspaCE statement. ?aWMU?S
gGE&}EoLU
end 5j~1%~,#
H;c3 x"
This occurs at the end but before the cleanup of ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, or UPDATE statements. EECuJ+T
9A,ok[J
executing -gB9476-
m[DCA\Mo@
The thread has begun executing a statement. R3|r`~@@
|*(R$t X
Execution of init_command H b?0?^#
UvF5u(o
The thread is executing statements in the value of the init_command system variable. } fJLY\
txik{' :
freeing items 722:2 {
<DZ$"t
The thread has executed a command. This state is usually followed by cleaning up. k}]M`ad
<,*3Av
Flushing tables UDW_?SHAx
0.[tEnLZ
The thread is executing FLUSH TABLES and is waiting for all threads to close their tables. MdDL?ev
|:]}u|O
FULLTEXT initialization &dG^ M2g-F
&2bqL!k
The server is preparing to perform a natural-language full-text search. sa TS8p z
2ck0k,WP
init !/e*v>3u&
nS](d2
This occurs before the initialization of ALTER TABLE, DELETE, INSERT, SELECT, or UPDATE statements. @H8DGeM
6Ad C
Killed ]iMqIh"
adPd}rt;
Someone has sent a KILL statement to the thread and it should abort next time it checks the kill flag. The flag is checked in each major loop in MySQL, but in some cases it might still take a short time for the thread to die. If the thread is locked by some other thread, the kill takes effect as soon as the other thread releases its lock. zdm2`D;~p
_+.JTk
Locked CeeAw_*@
"8R
&c}
The query is locked by another query. 4xH/a1&p=
Sy']fGvx
logging slow query S9{A}+"K
3YJ"[$w='(
The thread is writing a statement to the slow-query log. '4SDAa2f
)*`h)`\y
NULL fY6~Z
BvK
Z #T
This state is used for the SHOW PROCESSLIST state. 2WTOu x*
tt#dO@G#Fe
login s<rV1D
uovv">Uw
The initial state for a connection thread until the client has been authenticated successfully. Nk<^ Qv
[F'|KcE3
Opening tables, Opening table bK.*v4RG
loO"[8i.k
The thread is trying to open a table. This is should be very fast procedure, unless something prevents opening. For example, an ALTER TABLE or a LOCK TABLE statement can prevent opening a table until the statement is finished. Z %Ozzp/
#fYB4.i~
preparing
o8Gygi5
993f6
This state occurs during query optimization. FY ms]bv
s2#Ia>5!
Purging old relay logs m1U:&{:^
_$ivN!k
The thread is removing unneeded relay log files. fEX=csZ86
)@X0'X<
query end vWZXb`
>m>F {v
This state occurs after processing a query but before the freeing items state. -}9^$}PR
I5_HaC>
Reading from net Z*ip=FYR
80Dn!9j*
The server is reading a packet from the network. b,E ?{uG
4"|Xndh1.
Removing duplicates 3R3H+W0{
('tXv"fT
The query was using SELECT DISTINCT in such a way that MySQL could not optimize away the distinct operation at an early stage. Because of this, MySQL requires an extra stage to remove all duplicated rows before sending the result to the client. 4,e'B-.
<w{?b'/q
removing tmp table dRX~eIw
9{*{Ba
The thread is removing an internal temporary table after processing a SELECT statement. This state is not used if no temporary table was created. mb1mlsE
r3l1I}
rename zuV%`n
)l7XZ_gw'
The thread is renaming a table. >fH0>W+!
]JrD@ Vy
rename result table ;
oyV8P$
%MeAa?G-#
The thread is processing an ALTER TABLE statement, has created the new table, and is renaming it to replace the original table. BNfj0e 5b
yQ$irS?
Reopen tables ye^x>a['
,/\`Rc^n
The thread got a lock for the table, but noticed after getting the lock that the underlying table structure changed. It has freed the lock, closed the table, and is trying to reopen it. ?zW'Hi
V<QpC5
Repair by sorting qyz%9 9
6}^x#9\
The repair code is using a sort to create indexes. <=4$.2ym
4uXGpsL
Repair done &FXf]9
_X
)Te\6qM
The thread has completed a multi-threaded repair for a MyISAM table. `% 9Y)a/e
ynsYU(
Repair with keycache .I`>F/Sjr
/TMVPnvz.
The repair code is using creating keys one by one through the key cache. This is much slower than Repair by sorting. v;(cJ,l
{"p ~M7
Rolling back $bE"3/uf
y" =?l
The thread is rolling back a transaction. JI@iT6.%IX
+3))G
Saving state D[>:az`
=c6d$
For MyISAM table operations such as repair or analysis, the thread is saving the new table state to the .MYI file header. State includes information such as number of rows, the AUTO_INCREMENT counter, and key distributions. rCo}^M4Pb
[vr"FLM|9
Searching rows for update #'/rFT4{v
gbdzS6XW~
The thread is doing a first phase to find all matching rows before updating them. This has to be done if the UPDATE is changing the index that is used to find the involved rows. 9"[,9HN
%RW*gUvc]
Sending data CV[ 9i
X}GX6qAdt
The thread is processing rows for a SELECT statement and also is sending data to the client. |K.I%B
3X Y"s"
setup @Ov}X]ELi
hrX/,D -c
The thread is beginning an ALTER TABLE operation. !}}
)f/
jct=Nee|
Sorting for group
qbc= kP
hcW>R
The thread is doing a sort to satisfy a GROUP BY. ~"*W;|)
+6:
Sorting for order D_(NLC
}x|q*E\
The thread is doing a sort to satisfy a ORDER BY. 0OlT^
;P'5RCqj
Sorting index bR}fj.gP
M]%dFQ
The thread is sorting index pages for more efficient access during a MyISAM table optimization operation. Ze/\IBd
W$7H "tg
Sorting result IPn!iv)
"([gN:
For a SELECT statement, this is similar to Creating sort index, but for nontemporary tables. Q e/XEW
`'3&tAy
statistics "3 ++S
n5oX 51J
The server is calculating statistics to develop a query execution plan. #%%!r$UL
}l} _'FmQ
System lock 0$b4\.0>~
d"E3ypPK
The thread is going to request or is waiting for an internal or external system lock for the table. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same tables, you can disable external system locks with the --skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). pyX:$j2R+%
EUh_`R
Table lock ;"#y HP`
vgDpo@fz8
The next thread state after System lock. The thread has acquired an external lock and is going to request an internal table lock. /kw;q{>?o
}/\`'LQ
Updating Zl'/Mxg
?7lW@U0
The thread is searching for rows to update and is updating them. \Wg_ gA
4M]l~9;A
updating main table u>vvW|OB[
K0B<9Wi|
The server is executing the first part of a multiple-table update. It is updating only the first table, and saving columns and offsets to be used for updating the other (reference) tables. O^6anUV0
|N)),/R_
updating reference tables ^A=tk!C
Zo^]y'
The server is executing the second part of a multiple-table update and updating the matched rows from the other tables. D:IG;Rsc
'|yCDBu
User lock \G)F*
|6^%_kO!|
The thread is going to request or is waiting for an advisory lock requested with a GET_LOCK() call. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). gX-hYQrC
|#SZdXg
Waiting for tables, Waiting for table ZMiOKVl
liLhvcd
The thread got a notification that the underlying structure for a table has changed and it needs to reopen the table to get the new structure. However, to reopen the table, it must wait until all other threads have closed the table in question. z5~W
>r
N]|>\
This notification takes place if another thread has used FLUSH TABLES or one of the following statements on the table in question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE. H=f|X<8
dkCUU
Waiting on cond SZ$WC8AX
,5ZQPICF
A generic state in which the thread is waiting for a condition to become true. No specific state information is available. r;[ =y<Yf
C&*1H`n
Writing to net 2=0HQXXrq
S1mMz
i
The server is writing a packet to the network. Pgy[\t 2K
3. kill mysql Ö´ÐÐÏß³Ì qz (x
(1) show processlist;