一、环境准备
实验环境:centos 7
数据库版本:5.7.22
二、数据库安装
2.1 下载
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
2.2 解压
[root@localhost src]# tar -zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
2.3 复制
[root@localhost src]# cp -r mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql
2.4 添加系统mysql组和mysql用户
[root@localhost src]# groupadd mysql
[root@localhost src]# useradd -r -g mysql mysql
2.5 安装数据库
切到mysql安装目录
[root@localhost src]# cd /usr/local/mysql
修改当前目录拥有者为mysql用户
[root@localhost mysql]# chown -R mysql:mysql ./
安装数据库
[root@localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2018-08-13T03:20:19.548679Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-08-13T03:20:20.166625Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-08-13T03:20:20.333087Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-08-13T03:20:20.426986Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: cefdd8c5-9ea7-11e8-93d9-080027b2b4d5.
2018-08-13T03:20:20.429236Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-08-13T03:20:20.432428Z 1 [Note] A