---
name: "mysql_close"
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_close"
---

# mysql\_close(3)

### Name

mysql\_close - Closes a previously opened connection

### Synopsis

-

  ```
  #include <mysql.h>
  void mysql_close(MYSQL *mysql);
  ```

### Description

Closes a previously opened connection and deallocates all memory.

### Notes

- •

  To reuse a connection handle after `mysql_close()` the handle must be initialized again by **[mysql\_init(3)](/mysql_init/3.md)**.

### See also

- •

  **[mysql\_init(3)](/mysql_init/3.md)**

- •

  **[mysql\_real\_connect(3)](/mysql_real_connect/3.md)**
