一、阿里云虚拟私有网络的搭建
由于安全机制,无法上传,功能服务均已实现
二、通过编译、二进制安装MySQL5.7
2.1 编译安装
yum install cmake gcc gcc-c++ ncurses-devel bison zlib libxml openssl automake autoconf make libtool bison-devel libaio-devel openssl openssl-devel -y #安装源代码编译所需的依赖包
[root@Centos7 ~]# groupadd -r mysql #创建系统组mysql
[root@Centos7 ~]# useradd -r -s /sbin/nologin -g mysql mysql # 创建系统用户mysq,并将其加入到系统组mysql之中。
`
[root@Centos7 ~]# mkdir /data/mysql #创建MySQL存放数据库目录
[root@Centos7 ~]# chown -R mysql:mysql /data/mysql #该数据目录所属者、所属主必须是mysql。
[root@Centos7 ~]# tar -zxvf mysql-boost-5.7.30.tar.gz -C /usr/local/ #解压压缩文件至/usr/local下
[root@Centos7 usr]# cd local/
[root@Centos7 local]# ll
total 4
drwxr-xr-x. 2 root root 6 Apr 11 2018 bin
drwxr-xr-x. 2 root root 6 Apr 11 2018 etc
drwxr-xr-x. 2 root root 6 Apr 11 2018 games
drwxr-xr-x. 2 root root 6 Apr 11 2018 include
drwxr-xr-x. 2 root root 6 Apr 11 2018 lib
drwxr-xr-x. 2 root root 6 Apr 11 2018 lib64
drwxr-xr-x. 2 root root 6 Apr 11 2018 libexec
drwxr-xr-x 36 7161 31415 4096 Mar 24 2020 mysql-5.7.30
drwxr-xr-x. 2 root root 6 Apr 11 2018 sbin
drwxr-xr-x. 5 root root 49 Sep 27 19:52 share
drwxr-xr-x. 2 root root 6 Apr 11 2018 src
[root@Centos7 local]# mv mysql-5.7.30 mysql
[root@Centos7 local]# ll
total 4
drwxr-xr-x. 2 root root 6 Apr 11 2018 bin
drwxr-xr-x. 2 root root 6 Apr 11 2018 etc
drwxr-xr-x. 2 root root 6 Apr 11 2018 games
drwxr-xr-x. 2 root root 6 Apr 11 2018 include
drwxr-xr-x. 2 root root 6 Apr 11 2018 lib
drwxr-xr-x. 2 root root 6 Apr 11 2018 lib64
drwxr-xr-x. 2 root root 6 Apr 11 2018 libexec
drwxr-xr-x 36 7161 31415 4096 Mar 24 2020 mysql
drwxr-xr-x. 2 root root 6 Apr 11 2018 sbin
drwxr-xr-x. 5 root root 49 Sep 27 19:52 share
drwxr-xr-x. 2 root root 6 Apr 11 2018 src
#编译过程
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql #MySQL安装目录
-DMYSQL_DATADIR=/data/mysql #MySQL数据库目录
-DSYSCONFDIR=/etc #MySQL配置文件目录
-DMYSQL_USER=mysql #运行mysql进行的用户,如果没有需要提前添加用户和用户组
-DDEFAULT_CHARSET=utf8 #默认字符集
-DDEFAULT_COLLATION=utf8_general_ci #默认校对规则
-DWITH_SSL=system
-DWITH_BOOST=boost #boost库,带boost的源码包只需要这样即可,不带boost源码包需要指明boost目录
[root@Centos7 mysql]# make && make install #编译安装,时间较长,安装时建议加大内存和增加cpu数量。
#配置文件
[root@Centos7 ~]# cat /etc/my.cnf
[mysqld]
datadir=/data/mysql/
basedir=/usr/local/