1.环境说明
- 操作系统:Centos7.4 (CentOS-7-x86_64-Minimal-1804.iso)
- mysql:mysql8.0.13
卸载系统自带的mariadb-lib
- 查看mariadb版
- #rpm -qa|grep mariadb
- mariadb-libs-5.5.56-2.el7.x86_64
- 卸载mariadb
- rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
2.安装依赖环境
yum install -y openssl-devel.x86_64 openssl.x86_64
yum install -y libaio.x86_64 libaio-devel.x86_64
yum install -y perl.x86_64 perl-devel.x86_64
yum install -y perl-JSON.noarch
yum install -y autoconf
yum install -y wget
yum install -y net-tool
3.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
4.从网易镜像下载mysql安装包集合
镜像目录: https://mirrors.163.com/mysql/Downloads/MySQL-8.0/
5.按顺序安装
6.初始化数据库
#mysqld --initialize --console
临时密码在/var/log/mysql/mysql.log文件中
7.目录授权,否则启动失败
chown -R mysql:mysql /var/lib/mysql/
8.启动服务
service mysqld start
9.加密
mysql_secure_installation