skillfed

mycli

Rich MySQL terminal client with autocompletion, syntax highlighting, and dataframes

mycli v2.13.2 132.5K downloads/30d#11,549 on PyPI11,962
Permissive license BSD-3-Clause Active released

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 mycli

uv

uv add mycli

poetry

poetry add mycli

Installing 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

Environment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: SQLTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software Development

Tags

mysql command line clientsql terminal with auto-completionmysql cli with syntax highlightinginteractive database shellmysql replterminal sql clientmysql query tool
cli-tooldatabase-clientrepl

More Software Development packages