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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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 7 : Booting process
  2. How to shrink root filesystem on CentOS / RHEL 6
  3. How to Determine Which Process is Writing to Disk in Linux
  4. vnstat: command not found
  5. 7z – File archiver with a high compression ratio (Command Examples)
  6. vnstati Command Examples in Linux
  7. jarsigner: command not found
  8. getsebool: command not found
  9. brctl: command not found
  10. CentOS / RHEL 7 : Beginners guide to systemd targets (replacement of SysV init run levels)

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3 mv” Command Examples
  • “aws s3 mb” Command Examples
  • “aws s3 ls” Command Examples
  • “aws s3 cp” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright