mysql数据库安装SQL语句Table补全插件

安装必要条件

1、需要python开发环境

2、需要安装pip

python开发环境安装请移步

https://www.cnbugs.com/post-61.html

pip工具安装请移步

https://www.cnbugs.com/post-56.html

安装mycli工具

[root@wxj ~]# pip3 install -U mycli
 Collecting mycli
   Downloading https://files.pythonhosted.org/packages/f9/8a/9f96f12b482ff2e1bbb1d4252e14b4a24ed37daa5b1dcd14c3d990eca9dmycli-1.19.0-py2.py3-none-any.whl (56kB)
     100% |████████████████████████████████| 61kB 87kB/s 
 Requirement already up-to-date: Pygments>=1.6 in /usr/local/lib/python3.6/site-packages (from mycli)
 Collecting cli-helpers[styles]>=1.0.1 (from mycli)
   Downloading https://files.pythonhosted.org/packages/51/53/d94bb9cd98cd996da6eeea82a077293cd62b825d89a36d3c27714cae5e5cli_helpers-1.2.1-py3-none-any.whl
 Collecting configobj>=5.0.5 (from mycli)
   Downloading https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0faconfigobj-5.0.6.tar.gz
 Collecting sqlparse<0.3.0,>=0.2.2 (from mycli)
   Cache entry deserialization failed, entry ignored
   Downloading https://files.pythonhosted.org/packages/65/85/20bdd72f4537cf2c4d5d005368d502b2f464ede22982e724a82c86268edsqlparse-0.2.4-py2.py3-none-any.whl
 Requirement already up-to-date: prompt-toolkit>=2.0.6 in /usr/local/lib/python3.6/site-packages (from mycli)
 Collecting click>=4.1 (from mycli)
   Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599eClick-7.0-py2.py3-none-any.whl (81kB)
     100% |████████████████████████████████| 81kB 25kB/s 
 Collecting cryptography>=1.0.0 (from mycli)
   Cache entry deserialization failed, entry ignored
   Cache entry deserialization failed, entry ignored
   Downloading https://files.pythonhosted.org/packages/97/18/c6557f63a6abde34707196fb2cad1c6dc0dbff25a200d5044922496668acryptography-2.7-cp34-abi3-manylinux1_x86_64.whl (2.3MB)
     100% |████████████████████████████████| 2.3MB 68kB/s 
 Collecting PyMySQL>=0.9.2 (from mycli)
   Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae9PyMySQL-0.9.3-py2.py3-none-any.whl (47kB)
     100% |████████████████████████████████| 51kB 111kB/s 
 Collecting terminaltables>=3.0.0 (from cli-helpers[styles]>=1.0.1->mycli)
   Downloading https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bfterminaltables-3.1.0.tar.gz
 Collecting tabulate[widechars]>=0.8.2 (from cli-helpers[styles]>=1.0.1->mycli)
   Downloading https://files.pythonhosted.org/packages/c2/fd/202954b3f0eb896c53b7b6f07390851b1fd2ca84aa95880d7ae4f434c4atabulate-0.8.3.tar.gz (46kB)
     100% |████████████████████████████████| 51kB 219kB/s 
 Requirement already up-to-date: six in /usr/local/lib/python3.6/site-packages (from configobj>=5.0.5->mycli)
 Requirement already up-to-date: wcwidth in /usr/local/lib/python3.6/site-packages (from prompt-toolkit>=2.0.6->mycli)
 Collecting cffi!=1.11.3,>=1.8 (from cryptography>=1.0.0->mycli)
   Cache entry deserialization failed, entry ignored
   Cache entry deserialization failed, entry ignored
   Downloading https://files.pythonhosted.org/packages/5f/bf/6aa1925384c23ffeb579e97a5569eb9abce41b6310b329352b8252cee1ccffi-1.12.3-cp36-cp36m-manylinux1_x86_64.whl (430kB)
     100% |████████████████████████████████| 440kB 38kB/s 
 Collecting asn1crypto>=0.21.0 (from cryptography>=1.0.0->mycli)
   Cache entry deserialization failed, entry ignored
   Cache entry deserialization failed, entry ignored
   Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd0622asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
     100% |████████████████████████████████| 102kB 52kB/s 
 Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=1.0.0->mycli)
   Cache entry deserialization failed, entry ignored
   Cache entry deserialization failed, entry ignored
   Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206pycparser-2.19.tar.gz (158kB)
     100% |████████████████████████████████| 163kB 52kB/s 
 Installing collected packages: terminaltables, configobj, tabulate, cli-helpers, sqlparse, click, pycparser, cffi, asn1ypto, cryptography, PyMySQL, mycli
   Running setup.py install for terminaltables … done
   Running setup.py install for configobj … done
   Running setup.py install for tabulate … done
   Running setup.py install for pycparser … done
 Successfully installed PyMySQL-0.9.3 asn1crypto-0.24.0 cffi-1.12.3 cli-helpers-1.2.1 click-7.0 configobj-5.0.6 cryptogrhy-2.7 mycli-1.19.0 pycparser-2.19 sqlparse-0.2.4 tabulate-0.8.3 terminaltables-3.1.0
 You are using pip version 9.0.1, however version 19.2.1 is available.
 You should consider upgrading via the 'pip install --upgrade pip' command.

使用mycli工具

[root@wxj ~]# mycli -h localhost -u root 
 Password: 
 mysql 10.1.19-MariaDB
 mycli 1.19.0
 Chat: https://gitter.im/dbcli/mycli
 Mail: https://groups.google.com/forum/#!forum/mycli-users
 Home: http://mycli.net
 Thanks to the contributor - Kacper Kwapisz
 mysql root@localhost:(none)>    

测试mycli工具

按下table键,相关命令也就出来啦,是不是很方便呢?

发表评论

登录... 后才能评论