centos安装mysql的提示工具
一、安装Python3的依赖
yum install gcc openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel tk-devel wget curl-devel
二、下载Python3的安装文件
cd /home
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
三、解压Python3的安装文件
tar -zxvf Python-3.6.1.tgz -C /usr/local/
四、创建python3的编译安装目录
mkdir -p /usr/local/python3
五、编译安装Python
cd /usr/local/Python-3.6.1/
./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl
make && make install
六、创建软链接
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
七、验证是否成功
python3 -V
pip3 -V
八、MySQL的命令行客户端工具mycli,可以实现命令行自动完成补全和语法突出显示
pip3 install -U mycli
九、使用举例
Examples:
- mycli my_database
- mycli -u my_user -h my_host.com my_database
- mycli mysql://my_user@my_host.com:3306/my_database
mycli -uroot -p -D mysql -h 192.168.2.108