skillfed

mariadb

Python MariaDB extension

mariadb v1.1.14 407.1K downloads/30d#6,889 on PyPI149
Copyleft license LGPL 2.1 Active released

What it is and what it does

MariaDB Connector/Python is a database adapter that lets Python code connect to MariaDB and MySQL servers using the standard Python DB API 2.0 interface (PEP-249). It wraps the MariaDB Connector/C client library, which handles the low-level protocol and communication. The package is written in C for performance and is actively maintained by MariaDB Corporation.

You use it to execute SQL queries, fetch results, manage transactions, and handle database connections in a way that follows Python's standard database API conventions. It supports modern Python versions (3.9 through 3.14) and runs on Windows, macOS, and POSIX systems. Installation involves compiled extensions, so prebuilt wheels are provided for common platforms to reduce build friction.

Use it for:

  • Connect a Python web application to a MariaDB backend for user data, content, or transactional storage.
  • Build ETL or data pipeline scripts that read from or write to MariaDB databases.
  • Migrate from a legacy MySQL driver to a modern, actively maintained connector with DB API 2.0 compliance.
  • Develop system administration or monitoring tools that query MariaDB for operational metrics or configuration.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

MariaDB Connector/Python provides a DB API 2.0-compliant interface for Python programs to connect to and query MariaDB and MySQL databases using a C-based client library.

Yes, if you need to connect Python to MariaDB or MySQL and want an actively maintained, production-stable connector. The medium install friction is manageable thanks to prebuilt wheels for common platforms. Be aware of the LGPL 2.1 copyleft license if your application is proprietary, and verify the details of PYSEC-2026-217 before deploying in security-sensitive contexts.

Install

mariadb on PyPI

pip

pip install mariadb

uv

uv add mariadb

poetry

poetry add mariadb

Installing mariadb

Before you install

Medium install friction due to compiled C extensions; prebuilt wheels available for Windows and modern Python versions (3.9–3.14), but non-Windows platforms may require build tools. Maintenance is active with recent commits and production-stable status.

License in practice

Licensed under LGPL 2.1 or later (copyleft). Derivative works and modifications must be distributed under compatible terms; proprietary applications linking this library may face licensing constraints.

Quickstart

pip install mariadb

import mariadb

conn = mariadb.connect(
    user="user",
    password="password",
    host="localhost",
    database="mydb"
)
cursor = conn.cursor()
cursor.execute("SELECT * FROM table")
for row in cursor:
    print(row)
conn.close()

MariaDB Connector/C client library may need to be installed on the host system; consult documentation for platform-specific setup requirements.

Verify before relying

  • Whether MariaDB Connector/C client library must be installed separately on the host system for runtime operation.
  • Performance characteristics and connection pooling capabilities compared to other MariaDB/MySQL adapters.
  • Details on the single known vulnerability PYSEC-2026-217 and whether it affects current usage.

Package facts

License LGPL 2.1 (copyleft)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — packaging
Maintenance actively maintained — 311 days since the last release
Last repo commit
First released
Downloads 407,124/month — #6,889 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities 1 — PYSEC-2026-217

Evidence: mariadb-1.1.14-cp310-cp310-win32.whl; mariadb-1.1.14-cp310-cp310-win_amd64.whl; mariadb-1.1.14-cp311-cp311-win32.whl; mariadb-1.1.14-cp311-cp311-win_amd64.whl; mariadb-1.1.14-cp312-cp312-win32.whl; mariadb-1.1.14-cp312-cp312-win_amd64.whl; mariadb-1.1.14-cp313-cp313-win32.whl; mariadb-1.1.14-cp313-cp313-win_amd64.whl; mariadb-1.1.14-cp314-cp314-win32.whl; mariadb-1.1.14-cp314-cp314-win_amd64.whl; mariadb-1.1.14-cp39-cp39-win32.whl; mariadb-1.1.14-cp39-cp39-win_amd64.whl

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: MacOS XEnvironment :: Win32 (MS Windows)Intended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: System AdministratorsLicense :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Database

Tags

mariadb python connectormysql database python driverdb api 2.0 mariadbpython mariadb clientconnect to mariadb from pythonmariadb connector/pythonpep 249 database adapter
database-driverdb-api-2.0

More Database packages