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

# mariadb\_connection(3)

### Name

mariadb\_connection - checks if the client is connected to a MariaDB database server

### Synopsis

-

  ```
  #include <mysql.h>
  my_bool mariadb_connection(MYSQL * mysql);
  ```

### Description

Checks if the client is connected to a MariaDB or MySQL database server.

### Parameter

`mysql` - 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)**.

### Return value

Returns a non zero value if connected to a MariaDB database server, otherwise zero.
