a.执行rz -y 命令将压缩包上传到Linux文件夹
b.执行解压命令:
tar -xvf mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar
c.执行升级命令:apt-get upgrade
d.执行安装依赖包命令:apt-get install libaio1
e.按顺序安装一堆deb程序包
dpkg -i mysql-common_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-client_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
说明:安装顺序不要乱,如果在安装最后两个的时候报了一点依赖的小错不要慌张,正常的,按照上面的顺序继续往下执行安装命令,因为下面的3.4会讲到使用命令来修复依赖关系。
f.执行依赖修复命令:sudo apt-get -f install
g.安装server包:
dpkg -i mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
说明:如果此时报错 mysql-community-server depends onlibmecab2 (>= 0.996-1.1); however:Package libmecab2 is not installed.
在执行一下修复依赖的命令: sudo apt-get -f install
h.然后输入MySQL中root用户密码,一路回车即可
i.测试MySQL是否正常:mysql -V
j.执行mysql -u root -p可在正常登录
连接MySQL:mysql -u root -p
查看所有数据库:show databases;
quit或exit退出MySQL
来源:https://www.cnblogs.com/doublet/p/9765736.html