skillfed

asyncmy2

A fast asyncio MySQL driver

asyncmy2 v0.2.21 328.5K downloads/30d#7,555 on PyPI6
Permissive license Apache-2.0 Active released

What it is and what it does

asyncmy2 is an async MySQL/MariaDB driver designed for Python 3.10+ that combines the API of aiomysql with a Cython-rewritten protocol layer for faster execution. It supports both simple connections and connection pooling, and includes MySQL replication protocol support for streaming binary log events asynchronously.

The package is a community-maintained fork built on top of pymysql and aiomysql, reusing their design while accelerating the core protocol handling. It has been tested against both MySQL and MariaDB. No runtime dependencies are required beyond Python itself, though installation requires a C++ compiler (pre-installed on Linux/macOS, must be manually set up on Windows).

Use it for:

  • Building async web services that need concurrent MySQL queries without blocking I/O
  • Streaming MySQL replication events in real-time for data synchronization or analytics pipelines
  • Replacing aiomysql when performance is critical and Cython compilation overhead is acceptable
  • Connection pooling for high-concurrency applications handling many simultaneous database clients
  • Migrating from synchronous pymysql to async code while keeping familiar API patterns

Worth the install?

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

asyncmy2 is a fast asyncio-based MySQL/MariaDB driver that rewrites the core protocol in Cython for performance while maintaining API compatibility with aiomysql.

Yes, if you need async MySQL access and are willing to handle Cython compilation. The package is actively maintained, has no known vulnerabilities, and offers API compatibility with aiomysql while claiming performance gains. Install friction is moderate (compilation required, especially on Windows). Not recommended if you need Python versions below 3.10 or want to avoid build toolchain setup.

Install

asyncmy2 on PyPI

pip

pip install asyncmy2

uv

uv add asyncmy2

poetry

poetry add asyncmy2

Installing asyncmy2

Before you install

Medium install friction due to Cython compilation requirements. On Windows, Microsoft C++ Build Tools must be pre-installed. The package is actively maintained with a recent release and no known vulnerabilities.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution.

Quickstart

import asyncio
from asyncmy import connect

async def main():
    conn = await connect(user='root', password='')
    async with conn.cursor() as cursor:
        await cursor.execute('SELECT 1')
        result = await cursor.fetchone()
    await conn.ensure_closed()

asyncio.run(main())

Requires Python 3.10+. On Windows, Microsoft C++ Build Tools must be installed before package installation. On macOS/Linux, standard build tools are needed.

Verify before relying

  • Whether the Cython performance gains justify the compilation overhead for typical workloads
  • Compatibility scope with aiomysql—which specific API surface is covered
  • Production readiness given the project's recent creation (first release 2025-10-11)

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 12 days since the last release
Last repo commit
First released
Downloads 328,516/month — #7,555 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: asyncmy2-0.2.21-cp310-cp310-macosx_10_9_x86_64.whl; asyncmy2-0.2.21-cp310-cp310-macosx_11_0_arm64.whl; asyncmy2-0.2.21-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; asyncmy2-0.2.21-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; asyncmy2-0.2.21-cp310-cp310-musllinux_1_2_aarch64.whl; asyncmy2-0.2.21-cp310-cp310-musllinux_1_2_x86_64.whl; asyncmy2-0.2.21-cp310-cp310-win32.whl; asyncmy2-0.2.21-cp310-cp310-win_amd64.whl; asyncmy2-0.2.21-cp310-cp310-win_arm64.whl; asyncmy2-0.2.21-cp311-cp311-macosx_10_9_x86_64.whl; asyncmy2-0.2.21-cp311-cp311-macosx_11_0_arm64.whl; asyncmy2-0.2.21-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; asyncmy2-0.2.21-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; asyncmy2-0.2.21-cp311-cp311-musllinux_1_2_aarch64.whl; asyncmy2-0.2.21-cp311-cp311-musllinux_1_2_x86_64.whl; asyncmy2-0.2.21-cp311-cp311-win32.whl; asyncmy2-0.2.21-cp311-cp311-win_amd64.whl; asyncmy2-0.2.21-cp311-cp311-win_arm64.whl; asyncmy2-0.2.21-cp312-cp312-macosx_10_13_x86_64.whl; asyncmy2-0.2.21-cp312-cp312-macosx_11_0_arm64.whl

Keywords: driver, asyncio, mysql

Tags

async mysql driverasyncio mysql clientfast mysql asynciomariadb async drivermysql replication asynciocython mysql driveraiomysql compatible
async-databasemysql-drivercython-accelerated

More Database packages