本文参考自:https://blog.csdn.net/fanshujuntuan/article/details/78077433
背景:在ubuntu下用vagrant搭建了一个集群环境, 每个虚拟机的box是cenos/7, 每次在启动的时候, 需要在VagrantFile文件中配置,使得master虚拟机预装好mysql
无奈视频中给的脚本在我的机器上老是出错,于是有了下文自己的安装过程.
1.yum install wget
2. wget http://mirror.bit.edu.cn/mysql/Downloads/MySQL-5.7/mysql-5.7.16-1.el6.x86_64.rpm-bundle.tar(这个链接是北理工的开源镜像, 无奈官网太慢,还老是中断)
然后解压.....
[vagrant@10 ~]$ tar -xvf mysql-5.7.16-1.el6.x86_64.rpm-bundle.tar mysql-community-client-5.7.16-1.el6.x86_64.rpmmysql-community-embedded-5.7.16-1.el6.x86_64.rpmmysql-community-embedded-devel-5.7.16-1.el6.x86_64.rpmmysql-community-server-5.7.16-1.el6.x86_64.rpmmysql-community-test-5.7.16-1.el6.x86_64.rpmmysql-community-common-5.7.16-1.el6.x86_64.rpmmysql-community-libs-5.7.16-1.el6.x86_64.rpmmysql-community-devel-5.7.16-1.el6.x86_64.rpmmysql-community-libs-compat-5.7.16-1.el6.x86_64.rpm
别看解压之后这么多文件,有用的就四个文件,并且这四个文件必须按一定顺序安装,因为彼此依赖,顺序是:
mysql-community-common-5.7.16-1.el6.x86_64.rpm mysql-community-libs-5.7.16-1.el6.x86_64.rpm mysql-community-client-5.7.16-1.el6.x86_64.rpm mysql-community-server-5.7.16-1.el6.x86_64.rpm 但是在安装这四个文件之前, 还要装一些别的依赖 3.去除别的冲突的依赖
[vagrant@10 ~]$ rpm -qa | grep postfixpostfix-2.10.1-6.el7.x86_64[vagrant@10 ~]$ rpm -qa | grep mariadbmariadb-libs-5.5.56-2.el7.x86_64[vagrant@10 ~]$ sudo rpm -ev postfix-2.10.1-6.el7.x86_64Preparing packages...postfix-2:2.10.1-6.el7.x86_64[vagrant@10 ~]$ sudo rpm -ev mariadb-libs-5.5.56-2.el7.x86_64Preparing packages...mariadb-libs-1:5.5.56-2.el7.x86_64
4.安装别的依赖 sudo yum -y install libaio sudo yum -y install net-tools sudo yum -y install perl 5.下面正式安装那四个文件
[vagrant@10 ~]$ lsmysql-5.7.16-1.el6.x86_64.rpm-bundle.tarmysql-community-client-5.7.16-1.el6.x86_64.rpmmysql-community-common-5.7.16-1.el6.x86_64.rpmmysql-community-devel-5.7.16-1.el6.x86_64.rpmmysql-community-embedded-5.7.16-1.el6.x86_64.rpmmysql-community-embedded-devel-5.7.16-1.el6.x86_64.rpmmysql-community-libs-5.7.16-1.el6.x86_64.rpmmysql-community-libs-compat-5.7.16-1.el6.x86_64.rpmmysql-community-server-5.7.16-1.el6.x86_64.rpmmysql-community-test-5.7.16-1.el6.x86_64.rpm[vagrant@10 ~]$ sudo rpm -ivh mysql-community-common-5.7.16-1.el6.x86_64.rpm warning: mysql-community-common-5.7.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ################################# [100%]Updating / installing... 1:mysql-community-common-5.7.16-1.e################################# [100%][vagrant@10 ~]$ sudo rpm -ivh mysql-community-libs-5.7.16-1.el6.x86_64.rpm warning: mysql-community-libs-5.7.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ################################# [100%]Updating / installing... 1:mysql-community-libs-5.7.16-1.el6################################# [100%][vagrant@10 ~]$ sudo rpm -ivh mysql-community-client-5.7.16-1.el6.x86_64.rpm warning: mysql-community-client-5.7.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ################################# [100%]Updating / installing... 1:mysql-community-client-5.7.16-1.e################################# [100%][vagrant@10 ~]$ sudo rpm -ivh mysql-community-server-5.7.16-1.el6.x86_64.rpm warning: mysql-community-server-5.7.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ################################# [100%]Updating / installing... 1:mysql-community-server-5.7.16-1.e################################# [100%]
........................完结