---
name: "mysql_shutdown"
section: "3"
platform: "linux"
package: "mariadb"
version: "13.0.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mysql_shutdown"
---

# mysql\_shutdown(3)

### Name

mysql\_shutdown - Sends shutdown message to server

### Synopsis

-

  ```
  #include <mysql.h>
  int mysql_shutdown(MYSQL * mysql,
                     enum mysql_enum_shutdown_level);
  ```

### Description

This function is deprecated. Instead please use SQL `SHUTDOWN` command.

Sends a shutdown message to the server.

### Parameter

- •

  `mysql` - a mysql handle, which was previously allocated by **[mysql\_init(3)](/mysql_init/3.md)** and connected by **[mysql\_real\_connect(3)](/mysql_real_connect/3.md)**.

- •

  `mysql_enum_shutdown_level` - currently only one shutdown level, `SHUTDOWN_DEFAULT` is supported.

### Notes

- •

  To shutdown the database server, the user for the current connection must have SHUTDOWN privileges.

### Return value

Returns zero on success, non-zero on failure.

### See also

- •

  **[mysql\_kill(3)](/mysql_kill/3.md)**
