赞
踩
#下载安装包
到官网确定一下最新包
https://dev.mysql.com/downloads/mysql/
这里不是为了追求新的,只是因为mysql官网会删掉老的包,不找版本号,下面的全是404
如图最新版本是8.0.13
#!/bin/bash
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-client-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-common-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-devel-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-server-8.0.13-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-test-8.0.13-1.el7.x86_64.rpm
版本号自己替换
#卸载自带的libs
[root@yg2q-f01-02-tyss-02 mysql8]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[root@yg2q-f01-02-tyss-02 mysql8]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-test-8.0.13-1.el7.x86_64.rpm
这里顺序无所谓,报错再跑一边
因为是rpm安装,所以安装路径是默认的,
但是通常系统盘都很小,所以要修改数据目录
cat /etc/my.cnf 内容如下
这里要注意的就是server-id,自己修改一下,主从不能一致
[mysqld]
#basedir= /data/data/mysql/
datadir= /data/data/mysql/data/
port = 3306
socket = /data/data/mysql.sock
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。