Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MyCLI under Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install MyCLI under Linux", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to install MyCLI under Linux" this article.

MyCLI is the command line interface of MySQL,MariaDB and Percona, with automatic completion and syntax highlighting.

The MyCLI feature will automatically create a file ~ / .myclirc when you use it for the first time. Automatic completion is supported when entering keywords for SQL and tables, views, and columns in the database. Intelligent completion is also supported by default, and recommendations can be provided based on the relevance of the context.

For example:

SELECT * FROM-this will show the table name in the database. SELECT * FROM users WHERE-this will simply display the column name. By using Pygents support syntax highlighting support SSL connections to provide multi-line query support it can log each query and output to a file (disabled by default). Allows you to save a favorite query (save a query using the / fs alias and run it with the / f alias). Support for SQL statement execution and table query timing to print form data in a more attractive way how to install MyCLI for MySQL and MariaDB on Linux

On the Debian/Ubuntu distribution, you can easily install the MyCLI package using the apt command as follows:

$sudo apt-get update$ sudo apt-get install mycli

Similarly, there is a MyCLI package available on Fedora 22 +, which you can install using the dnf command as follows:

$sudo dnf install mycli

For other Linux distributions, such as RHEL/CentOS, you need to use Python's pip tool to install MyCLI. First, install pip using the following command:

$sudo yum install pip

After installing pip, you can install MyCLI as follows:

$sudo pip install mycli how to use MyCLI to connect MySQL and MariaDB in Linux

Once you have installed MyCLI, you can use it as follows:

$mycli-u root-h localhost

Automatic completion

Simple automatic completion can be done for keywords and SQL functions:

Intelligent completion

When the FROM keyword is entered, the table name will be completed:

Alias support

When the alias is set for the table name, the completion of the column name is also supported:

Syntax highlighting

MySQL syntax highlighting is supported:

Format the output of SQL

The output of MySQL is formatted by the less command:

To log in to MySQL and select the database at the same time, you can use a command similar to the following:

$mycli local_database$ mycli-h localhost-u root app_db$ mycli mysql://amjith@localhost:3306/django_poll

For more options, please enter:

$mycli-help

This is the whole content of this article. In this guide, we show how to install and use MyCLI in Linux with a few simple commands.

The above is all the contents of the article "how to install MyCLI under Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report