mysql命令行自动补全

1、基于python安装pip

[root@192~]# yum -y install python-pip python-devel
[root@192~]# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
[root@192 ~]# python get-pip.py  # 使用此命令出现黄字或类似字样出现不要担心,不是报错,只是警告您现在Python版本比较低为2.7

安装完毕Python后,你以为直接运行 pip install mycli 就可以完成安装mycli

[root@192 ~]# pip install mycli          # 直接输入此命令则会报如下错误(有些省略了)
  Found existing installation: configobj 4.7.2
ERROR: Cannot uninstall 'configobj'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

2、解决错误:

[root@192 ~]# pip install --ignore-installed mycli

3.、测试使用效果:

[root@192 ~]# mycli -uroot -p123.com
Traceback (most recent call last):
  File "/usr/bin/mycli", line 5, in 
    from mycli.main import cli
  File "/usr/lib/python2.7/site-packages/mycli/main.py", line 44, in 
    from .config import (write_default_config, get_mylogin_cnf_path,
  File "/usr/lib/python2.7/site-packages/mycli/config.py", line 28
    print(message, file=sys.stderr)

报错缺少一些Python的依赖包而导致的找不到文件

[root@192 ~]# yum -y install gcc libffi-devel python-devel openssl-devel &&  pip install mycli==1.8.1

4.登录
[root@192 ~]# mycli -uroot -p123.com # 以下为提示信息
Version: 1.8.1
Chat: https://gitter.im/dbcli/mycli
Mail: https://groups.google.com/forum/#!forum/mycli-users
Home: http://mycli.net
Thanks to the contributor - Nathan Taggart
mysql命令行自动补全_第1张图片

你可能感兴趣的:(mysql)