10bet网址
MySQL Internals Manual


14.6.9 COM_SHUTDOWN

Note

COM_SHUTDOWNis deprecated as of MySQL 5.7.9 and removed in MySQL 8.0. Instead, usemysql_query()to execute aSHUTDOWNstatement.

COM_SHUTDOWNis used to shut down the MySQL server.

TheSHUTDOWNprivilege 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) --0x08COM_SHUTDOWN

  • sub_command(1) -- optional if sub_command is0x00

    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

EOF_PacketorERR_Packet

Note

Even if several shutdown types are defined, right now only one is in use:SHUTDOWN_WAIT_ALL_BUFFERS