For the popular database servers like MySQL, MariaDB and Percona, you have to run different commands for the task like displaying the database, showing tables, listing users from tables and so on. With MyCLI, running such commands is easy. MyCLI is a command line interface (CLI) built using prompt_toolkit library and Python which provides syntax highlighting and auto-completion.
You can also configure MyCLI for the listing of previous commands with the up/down arrow key. So you don’t need to worry about typing the previous commands again. MyCLI has many such features to be used.
In this article, we are going to install MyCLI on Ubuntu 20.04 server and discuss the use cases of it with some examples. We are using a mysql server, however it works on MariaDB or Percona automatically.
To install MyCLI on Ubuntu 20.04 LTS server, you can run the command as shown below.
$ sudo apt update
$ sudo apt install mycli -y
With the above command, mycli will be completely installed and ready to use.
Here, we are going to use the MyCLI command for the popular database server MySQL. Lets run a few commands by using MyCLI features which makes it easy to run commands and syntax.
# mycli -u root -p database_name
Here, you can see the options to complete the syntax which makes it easy to choose one of the required ones.
Another example of running the command to show such a feature is as shown below.
As MyCLI has auto-completions feature, you can see the options to complete the syntax just by typing SELECT * F, it is showing the options like FROM which makes it easy to choose one of the required ones.
Also, to show its smart completions feature, we are going to show another example as shown below.
Here, we have pressed space after WHERE, it is showing options for related tables. In our case, it is showing column options for table pma__table__info.
This feature is also useful in many ways. Even after the table names are aliased, column completions will work. You can see the below example for further details.
You can enjoy such auto-completion, smart-completion, alias support, and many more such features of MyCLI by simply installing with the above instructions. Thank you!
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.
June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…
Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…
Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…
This is the first optimized Ubuntu Core image available on MediaTek’s Genio 350, 510, 700,…
Data centers are expensive: automation is the solution Today, managing a data center requires striking…
Our first Ubuntu IoT Day in Southeast Asia – and our first ever event in…