# aio-libs/aiomysql

aiomysql is a library for accessing a MySQL database from the asyncio

Repository: https://github.com/aio-libs/aiomysql
Canonical: https://ross.abutalabs.com/products/aiomysql
Homepage: https://aiomysql.rtfd.io
Language: Python
License: MIT
License Family: permissive
Topics: asyncio, mysql, mariadb, sqlalchemy, python, async, aiomysql
Last push: 2026-03-27T01:52:43+00:00

## Health v2 (maintenance only)
Score: 61/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 74, release rhythm 21, longevity 100
- inputs: {"age_days": 4256, "days_push": 160, "days_rel": 316, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1896, forks 272 (observed 2026-08-28T04:05:51.041628+00:00)

## What it is
aiomysql is an asyncio-based Python driver for accessing MySQL and MariaDB databases, built on top of PyMySQL with its I/O calls converted to async. It also offers optional SQLAlchemy integration ported from aiopg, preserving a familiar API for aiopg users.

## Use cases
- query MySQL from an asyncio Python application
- connect to MariaDB asynchronously
- use SQLAlchemy core with async MySQL connections
- pool async MySQL connections in a web app
- migrate aiopg-style code to MySQL
- run async database queries with cursors in Python

## When to choose
- you need async MySQL/MariaDB access in an asyncio codebase
- you want a PyMySQL-compatible API with await support
- you want SQLAlchemy integration similar to aiopg

## When to avoid
- you use synchronous code or another framework without asyncio
- you need a different database like PostgreSQL (use aiopg or asyncpg)
- you need an ORM with full async model support (consider SQLAlchemy 2.0 async or Tortoise ORM)

## Facets
- artifact type: library
- maturity: active
- function: database-driver, database, orm
- domain: databases, backend, developer-tools
- platform: python, cross-platform
- tags: asyncio, mysql, mariadb, pymysql, sqlalchemy, connection-pooling

## Member repositories
- aio-libs/aiomysql (main) score 61

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:51.041628+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:12:49.691822+00:00, confidence not recorded.
  - readme: https://github.com/aio-libs/aiomysql (fetched 2026-08-28T04:05:51.041628+00:00, sha c7de2425111c)
  - registry_pypi: https://pypi.org/pypi/aiomysql/json (fetched 2026-08-29T10:52:14.416561+00:00, sha 846b10f47e9d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
