mycli
Rich MySQL terminal client with autocompletion, syntax highlighting, and dataframes
What it is and what it does
mycli is a terminal-based MySQL client that replaces the standard mysql command-line tool with a modern, interactive interface. It connects to MySQL, MariaDB, Percona, TiDB, and Apache Doris databases and provides context-aware SQL auto-completion (suggesting table names after FROM, column names after WHERE), syntax highlighting via Pygments, and fuzzy history search. It supports multiline queries, favorite queries with Jinja templating, shell-style output redirection, and optional integration with Polars for dataframe transforms and plots.
The package has 19 runtime dependencies including prompt_toolkit (the interactive UI backbone), PyMySQL (database connection), sqlparse and sqlglot (SQL parsing), and optional tools like pyfzf (fuzzy search) and keyring (password storage). Installation is straightforward via pip; the project is actively maintained (last commit 2026-08-12) and well-established (first release 2015-07-26). It requires Python 3.10 or later and is tested on macOS and Linux with partial support for Windows and WSL.
Use it for:
- Interactive MySQL development and debugging when you need auto-completion and syntax highlighting instead of the bare mysql CLI.
- Running ad-hoc queries with fuzzy history search to quickly find and re-execute previous commands.
- Saving and executing parameterized queries using Jinja templating for repeated tasks with different values.
- Exploring large result sets using fzf output explorer or piping results to external tools with shell-style redirects.
- Querying multiple MySQL-compatible databases (MariaDB, Percona, TiDB, Doris) from a single unified client.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
mycli is a command-line client for MySQL and compatible databases (MariaDB, Percona, TiDB, Apache Doris) that provides auto-completion, syntax highlighting, and interactive query features.
Yes, if you regularly work with MySQL or compatible databases from the terminal. The auto-completion, syntax highlighting, and fuzzy search significantly improve the interactive query experience over the standard mysql client. Install via `pip install mycli[all]` to get all optional features. Note one known vulnerability (PYSEC-2023-213) exists; verify it does not affect your use case before deploying in production.
Install
mycli on PyPI
pip
pip install mycliuv
uv add myclipoetry
poetry add mycliInstalling mycli
Before you install
Low friction installation as a pure Python wheel. Active maintenance with a recent release (2 days old) and substantial community engagement (11962 GitHub stars). Requires Python 3.10 or better.
License in practice
BSD-3-Clause is permissive; you can use mycli freely in commercial and private projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install mycli
mycli --help
mycli -u root -p password -h localhost
Requires Python 3.10 or better; a MySQL-compatible database server must be accessible at connection time.
Verify before relying
- Whether the single known vulnerability (PYSEC-2023-213) affects current version 2.13.2 or has been patched.
- Performance characteristics when handling very large result sets or complex queries.
- Stability and feature completeness on Windows (documentation notes partial support).
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 19 — click, clickdc, cryptography, Pygments, prompt_toolkit, PyMySQL, sqlparse, sqlglot, sqlglotc, configobj, cli_helpers, wcwidth, pyperclip, pycryptodomex, pyfzf, rapidfuzz, keyring, jinja2, yaspin |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 132,482/month — #11,549 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | 1 — PYSEC-2023-213 |
Evidence: mycli-2.13.2-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
litecliA command-line client for SQLite databases with…
permissive · top 15,000 on PyPI
pgclipgcli is a command-line interface for…
permissive · top 15,000 on PyPI
mysqlclientmysqlclient provides a Python interface to…
copyleft · top 1,000 on PyPI
PyMySQLPyMySQL is a pure-Python MySQL and MariaDB…
permissive · top 1,000 on PyPI
aiomysqlaiomysql provides async/await access to MySQL…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-mysqlclientAdds OpenTelemetry tracing instrumentation to…
permissive · top 5,000 on PyPI
hopsworks-aiomysqlAsync MySQL database driver for Python asyncio…
permissive · top 15,000 on PyPI
mysql-connectorMySQL driver written in Python that enables…
copyleft · top 5,000 on PyPI
types-mysqlclientProvides type annotations for the mysqlclient…
permissive · top 15,000 on PyPI