Documentation Home
MySQL Internals Manual


14.6.9 COM_SHUTDOWN

Note

COM_SHUTDOWN is deprecated as of MySQL 5.7.9 and removed in MySQL 8.0. Instead, use mysql_query() to execute a SHUTDOWN statement.

COM_SHUTDOWN is used to shut down the MySQL server.

The SHUTDOWN 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

    wait for existing connections to finish

    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_Packet or ERR_Packet

Note

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


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.