COM_SHUTDOWN
is deprecated as of MySQL 5.7.9 and removed in MySQL 8.0. Instead, usemysql_query()
to execute aSHUTDOWN
statement.
COM_SHUTDOWN
is used to shut down the MySQL server.
TheSHUTDOWN
privilege is required for this operation.
-
COM_SHUTDOWN
: -
shut down the server
- Payload
-
1 [08] COM_SHUTDOWN if more data { 1 shutdown type }
- Fields
-
command(1) --
0x08
COM_SHUTDOWN
sub_command(1) -- optional if sub_command is
0x00
Type
Constant Name
Description
0x00
SHUTDOWN_DEFAULT
defaults to SHUTDOWN_WAIT_ALL_BUFFERS
0x01
SHUTDOWN_WAIT_CONNECTIONS
等待完成现有的连接
0x02
SHUTDOWN_WAIT_TRANSACTIONS
wait for existing trans to finish
0x08
SHUTDOWN_WAIT_UPDATES
wait for existing updates to finish (=> no partial MyISAM update)
0x10
SHUTDOWN_WAIT_ALL_BUFFERS
flush InnoDB buffers and other storage engines' buffers
0x11
SHUTDOWN_WAIT_CRITICAL_BUFFERS
don't flush InnoDB buffers, flush other storage engines' buffers
0xfe
KILL_QUERY
0xff
KILL_CONNECTION
- Returns
NoteEven if several shutdown types are defined, right now only one is in use:
SHUTDOWN_WAIT_ALL_BUFFERS