> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-python.md).

# Connector/Python

## MariaDB Connector/Python

MariaDB Connector/Python enables python programs to access MariaDB and MySQL databases, using an API which is compliant with the Python DB API 2.0 ([PEP-249](https://peps.python.org/pep-249)).

{% hint style="info" %}
**Version 2.0 is currently a Release Candidate (RC); version 1.1 is the latest stable (GA) release.** Because 2.0 is not yet GA, install it with the `--pre` flag (for example `pip install --pre mariadb`); a plain `pip install mariadb` installs the latest stable release (1.1). See the [Installation](/docs/connectors/mariadb-connector-python/install.md) page for details. Do not use non-stable (non-GA) releases in production.
{% endhint %}

{% columns %}
{% column %}
{% content-ref url="/pages/pOuUCSCDfVmkqkymusxh" %}
[About Connector/Python](/docs/connectors/mariadb-connector-python/mariadb-connector-python-guide.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Overview of MariaDB Connector/Python: a PEP-249-compliant DB API 2.0 driver supporting sync and async operations, available as pure Python, a C extension, or pre-compiled binary wheels.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/7u8ImHzadf6MC2SS1l9t" %}
[Installation](/docs/connectors/mariadb-connector-python/install.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Install MariaDB Connector/Python via pip with pure Python, C extension, or binary wheel options; connection pooling requires the separate `mariadb[pool]` extra.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/nRxCTL1HId3WwdTrnCG8" %}
[Basic Usage](/docs/connectors/mariadb-connector-python/usage.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Basic usage of MariaDB Connector/Python covers connecting, parameterized queries with `execute` and `executemany`, and NULL and default value handling with indicators.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/hFmvFRPRKsAjqUoehyqV" %}
[Async/Await Support](/docs/connectors/mariadb-connector-python/async-usage.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Async/await support in MariaDB Connector/Python 2.0 enables non-blocking database operations via `asyncConnect`, `AsyncCursor`, and `create_async_pool` for asyncio-based Python applications.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/At6eCfFtnufgV5up2aAp" %}
[Connection Pooling](/docs/connectors/mariadb-connector-python/pooling.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python 2.0 connection pooling supports sync and async pools via `create_pool` and `create_async_pool`, with configurable size, health checks, and context managers.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/jvpIyWd2YV5x1uvGZat4" %}
[Migration Guide: 1.1 to 2.0](/docs/connectors/mariadb-connector-python/migration-from-1.1-to-2.0.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Migration from MariaDB Connector/Python 1.1 to 2.0 covers renamed parameters, removed auto-reconnect, updated pooling, URI connections, async/await support, and a migration checklist.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/GDI1kosTzsRaFqW5oimo" %}
[Application Development](/docs/connectors/mariadb-connector-python/application-development.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Application development with MariaDB Connector/Python.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/aScmcdvfAmlr5tPtreoZ" %}
[API Reference](/docs/connectors/mariadb-connector-python/api.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python API reference covers the module, connection class, cursor class, async/await support, connection pooling, and constants used in Python database applications.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/SWAsJMeXK38HfWBxvKpj" %}
[License](/docs/connectors/mariadb-connector-python/license.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python is licensed under the GNU LGPL v2.1; the accompanying documentation is covered by the Creative Commons Attribution 3.0 license.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/7EsYTH0iD56vOF0lIOx0" %}
[Bug Reports](/docs/connectors/mariadb-connector-python/bugs.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python bug reports are filed in the Jira CONPY project. Effective reports include version details, a short reproducing script, and table definitions where relevant.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/8yPG4TXItznwusRU4BI7" %}
[Setup for Examples](/docs/connectors/mariadb-connector-python/setup-for-examples.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Set up the test database, contacts and accounts tables, and a user account required by the MariaDB Connector/Python code examples in this documentation.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/9gguC6jsNX5IfZU6avbr" %}
[Transactions with MariaDB Connector/Python](/docs/connectors/mariadb-connector-python/transactions-with-mariadb-connector-python.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python transactions default to manual commit; the Connection class provides `commit` and `rollback`, with async transaction support via `asyncConnect` in version 2.0.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/WQJskA8tp65kZ6uQ30Co" %}
[MariaDB Connector/Python FAQ](/docs/connectors/mariadb-connector-python/faq.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB Connector/Python FAQ addresses common installation issues, migration from 1.1 to 2.0, the binary vs text protocol distinction, async setup, and transaction commit requirements.
{% endcolumn %}
{% endcolumns %}

{% @marketo/form formId="4316" %}
