一、准备工作
- 检查是否存在 mariadb,如果存在移除
rpm -e mariadb-version
- 安装依赖包 libaio 和 libaio1
yum -y install libaio*
- 下载安装包
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
二、创建 mysql 用户
shell> groupadd mysql
shell> useradd -r -g mysql mysql
三、准备安装目录和权限设置
shell> cp mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz /usr/local/
shell> tar -xf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
shell> ln -s mysql-5.7.26-linux-glibc2.12-x86_64 mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> mkdir data
shell> chown -R mysql:mysql data
四、准备配置文件 my.cnf
shell> cd /etc
shell> touch /etc/my.cnf
shell> vim /etc/my.cnf
将下面的配置文件示例插入新的