MyCLI is a command line interface for mysql, MariaDB, and Percona with auto-completion and syntax highlighting. This will help us to write queries faster and easy which was written in python prompt_toolkit.

The REPL (Read, Eval, Print, Loop) will pop up a suggestion menu as soon as you start typing. The suggestions are context sensitive based on the position of the cursor.

Frequently used queries can be saved as favorite queries with a short name, which can be retrieved whenever we want by invoking /f .

MyCli keeps track of the queries entered in the repl. Up/Down arrow can be used to navigate the history. Mycli uses pager programs to make it easier to view largeresult sets. This can be configured or disabled.

Mycli Features : Auto-completion as you type for SQL keywords as well as tables, views and columns in the database. Syntax highlighting using Pygments. Smart-completion (enabled by default) will suggest context-sensitive completion. SELECT * FROM will only show table names. SELECT * FROM users WHERE will only show column names. Support for multiline queries. Favorite queries. Save a query using \fs alias query and execute it with \f alias whenever you need. Timing of sql statments and table rendering. Config file is automatically created at ~/.myclirc at first launch. Log every query and its results to a file (disabled by default). Pretty prints tabular data (with colors!) Support for SSL connections

MyCLI is very useful since lot’s of small companies & CMS (Content Management System) application such as WordPress, Joomla, Moodle, etc,., using MysQL/MariaDB as aback end.

MyCLI config file is located @ ~/.myclirc and you have plenty of options for customization. The config file is created when mycli is launched for the very first time. Default log file is located at ~/.mycli.log .

How to install Mycli on linux

Make sure your system should have python-pip package in order to install Mycli. pip is a python module bundled with setuptools, it’s one of the recommended tool for installing Python packages in Linux.

For Debian/Ubuntu , useapt-get command orapt command to install Mycli.

$ sudo apt install python-pip

Alternatively we can install from distribution official repository but you might get bit older version.

$ sudo apt-get install mycli

For RHEL/CentOS , useYUM command to install Mycli.

$ sudo yum install python-pip python-devel

For Fedora , usednf command to install Mycli.

$ sudo dnf install python-pip

Mycli package was included in Fedora system since Fedora 22, so you can easily install from distribution official repository but you might get bit older version.

$ sudo dnf install mycli

For Arch Linux , usepacman command to install Mycli.

$ sudo pacman -S python-pip

Finally Install Mycli using pip command

$ pip install mycli How to use Mycli

Just run the following command to invoke mycli interface and start enjoying with AutoCompletion And Syntax Highlighting

$ mycli -u user -p db_name
$ mycli -u root -p
Mycli   Simple CLI Client For MySQL/MariaDB With AutoCompletion And Syntax High ...

Auto-completion :Simple completions such as keywords and sql-functions.


Mycli   Simple CLI Client For MySQL/MariaDB With AutoCompletion And Syntax High ...

Smart-completion :Table name completions after the ‘FROM’ keyword.


Mycli   Simple CLI Client For MySQL/MariaDB With AutoCompletion And Syntax High ...

Column names are scoped to the table referenced in the query.


Mycli   Simple CLI Client For MySQL/MariaDB With AutoCompletion And Syntax High ...

本文数据库(mysql)相关术语:navicat for mysql mysql workbench mysql数据库 mysql 存储过程 mysql安装图解 mysql教程 mysql 管理工具

主题: SQLMySQLLinuxDebianUbuntuPythonWord
tags: install,Mycli,mycli,pip,command,python,completion
分页:12
转载请注明
本文标题:Mycli Simple CLI Client For MySQL/MariaDB With AutoCompletion And Syntax High ...
本站链接:http://www.codesec.net/view/561347.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mysql) | 评论(0) | 阅读(88)