A brief introduction to the command line tool mycli for operating MySQL database

A brief introduction to the command line tool mycli for operating MySQL database

GitHub has all kinds of magic tools. Today I found a command line tool for operating databases, which can automatically complete and highlight syntax. In the past, when typing SQL in the terminal, you not only had to remember the table name and field name, but also various functions to type out a complete statement, otherwise you had to Google Baidu to check the document first.

With the mycli command line auxiliary tool, I can save a lot of trouble. You can first look at the effect diagram:

If you don’t try it yourself, the feeling may not be so strong, so you might as well try it yourself. Under normal circumstances, you can install it directly using the pip command

pip install mycli

If the installation goes wrong, you can refer to the official documentation, or upgrade your pip tool. I need to upgrade pip to install it normally in the CentOS environment.

$ sudo yum install python-pip

mycli supports multiple platforms, including Windows, macOS, and Linux. How to use it? mycli completely inherits the parameters in the mysql command, so there is no learning cost.

Connect to the database, mysql also does this:

mycli -u your_user_name -h your_host -p your_password --database your_db_name 

After successfully connecting to the database, the operation is the same as usual when using SQL input. The only difference is that there will be an automatic prompt for each character typed, the keywords are highlighted, and multiple prompt items can be switched up and down by pressing the Tab key to select different items.

Why not try it yourself?

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to use PHP mysql_fetch_row to query and obtain a list of data rows
  • 5 MySQL GUI tools recommended to help you with database management
  • Why should the number of rows in a single MySQL table not exceed 5 million?
  • PHP uses mysqli and pdo extensions to test and compare the execution efficiency of mysql database. Complete example
  • Will MySQL execute the update statement again if it has the same data as the original one?
  • IDEA uses properties configuration file to connect to MySQL database
  • How to use binlog for data recovery in MySQL
  • Detailed explanation of MySQL database Event scheduled execution tasks
  • Solve the Chinese garbled problem of mysql5.5 database command line under Windows 10
  • Java connects, queries and modifies MySQL database
  • Detailed explanation of MySQL data rows and row overflow mechanism

<<:  Using Apache ab to perform http performance testing

>>:  How to create a basic image of the Python runtime environment using Docker

Recommend

Solution to MySql service disappearance for unknown reasons

Solution to MySql service disappearance for unkno...

Uninstalling MySQL database under Linux

How to uninstall MySQL database under Linux? The ...

HTML dl, dt, dd tags to create a table vs. Table creation table

Not only does it reduce the cost of website develo...

Summary of problems encountered when installing docker on win10 home version

Docker download address: http://get.daocloud.io/#...

Detailed explanation of how MySQL (InnoDB) handles deadlocks

1. What is deadlock? The official definition is a...

Nginx source code compilation and installation process record

The installation of the rpm package is relatively...

Detailed explanation of Mencached cache configuration based on Nginx

Introduction Memcached is a distributed caching s...

JavaScript implementation of classic snake game

This article shares the specific code of JavaScri...

MySQL 5.7.21 winx64 installation and configuration method graphic tutorial

This article summarizes the notes for installing ...

MySQL 5.7.17 winx64 installation and configuration graphic tutorial

I summarized the previous notes on installing MyS...

Problems with creating placeholders for HTML selection boxes

I'm using a placeholder in a text input and i...

How to implement remote automatic backup of MongoDB in Linux

Preface After reading the previous article about ...

Summary of MySQL composite indexes

Table of contents 1. Background 2. Understanding ...

Detailed explanation of webpack-dev-server core concepts and cases

webpack-dev-server core concepts Webpack's Co...