• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mycli Command Examples in Linux

by Deepika

mycli is a command-line interface (CLI) for interacting with MySQL, MariaDB, and Percona databases. It provides an alternative to using the traditional MySQL command-line client, and offers several advanced features to make it easier and more efficient to interact with databases.

Some of the key features of mycli include:

  • Auto-completion: As you type, mycli will suggest possible completions for commands, tables, and columns, making it faster and easier to enter complex SQL queries.
  • Syntax highlighting: mycli will highlight SQL keywords, strings, and other syntax elements, making it easier to read and identify errors in your SQL code.
  • Multi-line editing: mycli supports editing of multi-line SQL statements, making it easier to write and maintain complex queries.
  • Query history: mycli keeps a record of all the SQL statements you have executed, so you can easily repeat previous commands or review your work.
  • Context-sensitive help: mycli provides help on SQL commands and functions, so you can quickly find information on how to use specific features.

mycli is designed to be used by database administrators, developers, and other users who need to interact with databases from the command line. It is available for Windows, MacOS, and Linux, and can be installed using pip or other package managers.

mycli Command Examples

1. Connect to a local database on port 3306, using the current user’s username:

# mycli database_name

2. Connect to a database (user will be prompted for a password):

# mycli -u username database_name

3. Connect to a database on another host:

# mycli -h database_host -P port -u username database_name

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to add iptable rules
  2. flarectl: Official CLI for Cloudflare
  3. md5sum: command not found
  4. rc-status: command not found
  5. terminator Command Examples in Linux
  6. cradle elastic: Manage the Elasticsearch instances for a Cradle instance
  7. gimp: GNU image manipulation program
  8. dlv: Debugger for the Go programming language
  9. kwriteconfig5: command not found
  10. “go test” Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright