Install MySQL 5.7 in the Docker

Install Docker on Oracle Linux 7
在Oracle Linux 7.1上安装Docker
1.首先使用正确的yum设置来升级Oracle Linux 7.1实例。为了安装最新的Docker版本(18.9.1.ce),需要ol7_latest,ol7_uekr4与ol7_addons启用

[root@localhost /]# cd /etc/yum.repos.d/
[root@localhost /]#wget http://yum.oracle.com/public-yum-ol7.repo
[root@localhost yum.repos.d]# vi public-yum-ol7.repo
[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

2.开始安装docker

[root@localhost yum.repos.d]# yum install docker-engine
Loaded plugins: langpacks
ol7_UEKR4                                                                                                                                                                                                            | 2.5 kB  00:00:00
ol7_addons                                                                                                                                                                                                           | 1.2 kB  00:00:00
ol7_latest                                                                                                                                                                                                           | 2.7 kB  00:00:00
(1/4): ol7_addons/x86_64/updateinfo                                                                                                                                                                                  |  60 kB  00:00:00
(2/4): ol7_UEKR4/x86_64/updateinfo                                                                                                                                                                                   |  82 kB  00:00:01
(3/4): ol7_addons/x86_64/primary                                                                                                                                                                                     |  82 kB  00:00:02
(4/4): ol7_UEKR4/x86_64/primary_db                                                                                                                                                                                   | 4.0 MB  00:03:38
ol7_addons                                                                                                                                                                                                                          328/328
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:18.09.1.ol-1.0.5.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.77 for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libseccomp >= 2.3 for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: containerd for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: docker-cli for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: runc for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libdevmapper.so.1.02(DM_1_02_97)(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libsystemd.so.0(LIBSYSTEMD_209)(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libsystemd.so.0()(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.77-5.el7 will be installed
--> Processing Dependency: selinux-policy-base >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: selinux-policy >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: policycoreutils >= 2.5-11 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
---> Package containerd.x86_64 0:1.2.0-1.0.5.el7 will be installed
---> Package device-mapper-libs.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper-libs = 7:1.02.93-3.el7 for package: 7:device-mapper-1.02.93-3.el7.x86_64
---> Package device-mapper-libs.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package docker-cli.x86_64 0:18.09.1.ol-1.0.5.el7 will be installed
---> Package libseccomp.x86_64 0:2.1.1-2.el7 will be updated
---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be an update
---> Package runc.x86_64 0:1.0.0-19.rc5.git4bb1fe4.0.3.el7 will be installed
--> Processing Dependency: criu for package: runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64
---> Package systemd-libs.x86_64 0:208-20.0.1.el7 will be updated
--> Processing Dependency: systemd-libs = 208-20.0.1.el7 for package: systemd-208-20.0.1.el7.x86_64
---> Package systemd-libs.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: liblz4.so.1()(64bit) for package: systemd-libs-219-62.0.4.el7_6.7.x86_64
--> Running transaction check
---> Package criu.x86_64 0:3.9-5.el7 will be installed
--> Processing Dependency: libprotobuf-c.so.1(LIBPROTOBUF_C_1.0.0)(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libnl-3.so.200(libnl_3)(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libprotobuf-c.so.1()(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libnet.so.1()(64bit) for package: criu-3.9-5.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper = 7:1.02.93-3.el7 for package: 7:device-mapper-event-1.02.93-3.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package lz4.x86_64 0:1.7.5-2.0.1.el7 will be installed
---> Package policycoreutils.x86_64 0:2.2.5-15.0.1.el7 will be updated
--> Processing Dependency: policycoreutils = 2.2.5-15.0.1.el7 for package: policycoreutils-python-2.2.5-15.0.1.el7.x86_64
---> Package policycoreutils.x86_64 0:2.5-29.0.1.el7_6.1 will be an update
--> Processing Dependency: libsemanage >= 2.5-14 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol >= 2.5-10 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libselinux-utils >= 2.5-14 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.1)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsemanage.so.1(LIBSEMANAGE_1.1)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.0)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
---> Package selinux-policy.noarch 0:3.13.1-23.0.1.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-229.0.3.el7_6.12 will be an update
---> Package selinux-policy-targeted.noarch 0:3.13.1-23.0.1.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-229.0.3.el7_6.12 will be an update
---> Package systemd.x86_64 0:208-20.0.1.el7 will be updated
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: libgudev1-208-20.0.1.el7.x86_64
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: systemd-sysv-208-20.0.1.el7.x86_64
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: systemd-python-208-20.0.1.el7.x86_64
---> Package systemd.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: kmod >= 18-4 for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Processing Dependency: libcryptsetup.so.12(CRYPTSETUP_2.0)(64bit) for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Processing Dependency: libcryptsetup.so.12()(64bit) for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Running transaction check
---> Package cryptsetup-libs.x86_64 0:1.6.6-3.el7 will be updated
--> Processing Dependency: cryptsetup-libs = 1.6.6-3.el7 for package: cryptsetup-python-1.6.6-3.el7.x86_64
--> Processing Dependency: cryptsetup-libs(x86-64) = 1.6.6-3.el7 for package: cryptsetup-1.6.6-3.el7.x86_64
---> Package cryptsetup-libs.x86_64 0:2.0.3-3.el7 will be an update
---> Package device-mapper-event.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper-event = 7:1.02.93-3.el7 for package: 7:lvm2-libs-2.02.115-3.el7.x86_64
---> Package device-mapper-event.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
--> Processing Dependency: device-mapper-event-libs = 7:1.02.149-10.0.3.el7_6.8 for package: 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64
---> Package kmod.x86_64 0:14-10.el7 will be updated
---> Package kmod.x86_64 0:20-23.0.1.el7 will be an update
---> Package libgudev1.x86_64 0:208-20.0.1.el7 will be updated
---> Package libgudev1.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: glib2 >= 2.42 for package: libgudev1-219-62.0.4.el7_6.7.x86_64
---> Package libnet.x86_64 0:1.1.6-7.el7 will be installed
---> Package libnl3.x86_64 0:3.2.21-8.0.1.el7 will be updated
--> Processing Dependency: libnl3 = 3.2.21-8.0.1.el7 for package: libnl3-cli-3.2.21-8.0.1.el7.x86_64
---> Package libnl3.x86_64 0:3.2.28-4.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.2.2-6.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-14.1.el7 will be an update
--> Processing Dependency: libselinux(x86-64) = 2.5-14.1.el7 for package: libselinux-utils-2.5-14.1.el7.x86_64
---> Package libsemanage.x86_64 0:2.1.10-16.el7 will be updated
--> Processing Dependency: libsemanage = 2.1.10-16.el7 for package: libsemanage-python-2.1.10-16.el7.x86_64
---> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
---> Package libsepol.x86_64 0:2.1.9-3.el7 will be updated
---> Package libsepol.x86_64 0:2.5-10.el7 will be an update
---> Package policycoreutils-python.x86_64 0:2.2.5-15.0.1.el7 will be updated
---> Package policycoreutils-python.x86_64 0:2.5-29.0.1.el7_6.1 will be an update
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64
---> Package protobuf-c.x86_64 0:1.0.2-3.el7 will be installed
---> Package systemd-python.x86_64 0:208-20.0.1.el7 will be updated
---> Package systemd-python.x86_64 0:219-62.0.4.el7_6.7 will be an update
---> Package systemd-sysv.x86_64 0:208-20.0.1.el7 will be updated
---> Package systemd-sysv.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Running transaction check
---> Package cryptsetup.x86_64 0:1.6.6-3.el7 will be updated
---> Package cryptsetup.x86_64 0:2.0.3-3.el7 will be an update
---> Package cryptsetup-python.x86_64 0:1.6.6-3.el7 will be updated
---> Package cryptsetup-python.x86_64 0:2.0.3-3.el7 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.93-3.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package glib2.x86_64 0:2.40.0-4.el7 will be updated
---> Package glib2.x86_64 0:2.56.1-4.el7_6 will be an update
---> Package libnl3-cli.x86_64 0:3.2.21-8.0.1.el7 will be updated
---> Package libnl3-cli.x86_64 0:3.2.28-4.el7 will be an update
---> Package libselinux.x86_64 0:2.2.2-6.el7 will be updated
--> Processing Dependency: libselinux = 2.2.2-6.el7 for package: libselinux-python-2.2.2-6.el7.x86_64
---> Package libselinux.x86_64 0:2.5-14.1.el7 will be an update
---> Package libsemanage-python.x86_64 0:2.1.10-16.el7 will be updated
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be an update
---> Package lvm2-libs.x86_64 7:2.02.115-3.el7 will be updated
--> Processing Dependency: lvm2-libs = 7:2.02.115-3.el7 for package: 7:lvm2-2.02.115-3.el7.x86_64
--> Processing Dependency: lvm2-libs = 7:2.02.115-3.el7 for package: 7:lvm2-python-libs-2.02.115-3.el7.x86_64
---> Package lvm2-libs.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
---> Package setools-libs.x86_64 0:3.3.7-46.el7 will be updated
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be an update
--> Running transaction check
---> Package libselinux-python.x86_64 0:2.2.2-6.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-14.1.el7 will be an update
---> Package lvm2.x86_64 7:2.02.115-3.el7 will be updated
---> Package lvm2.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
--> Processing Dependency: device-mapper-persistent-data >= 0.7.0-0.1.rc6 for package: 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64
---> Package lvm2-python-libs.x86_64 7:2.02.115-3.el7 will be updated
---> Package lvm2-python-libs.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.4.1-2.el7 will be updated
---> Package device-mapper-persistent-data.x86_64 0:0.7.3-3.el7 will be an update
--> Processing Conflict: systemd-219-62.0.4.el7_6.7.x86_64 conflicts initscripts < 9.49.28-1
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package initscripts.x86_64 0:9.49.24-1.0.1.el7 will be updated
---> Package initscripts.x86_64 0:9.49.46-1.0.1.el7 will be an update
--> Processing Conflict: initscripts-9.49.46-1.0.1.el7.x86_64 conflicts redhat-release < 7.5-0.11
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package redhat-release-server.x86_64 1:7.1-1.0.2.el7 will be updated
---> Package redhat-release-server.x86_64 1:7.6-4.0.1.el7 will be an update
--> Processing Conflict: initscripts-9.49.46-1.0.1.el7.x86_64 conflicts oraclelinux-release < 7:7.5-1.0.3
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package oraclelinux-release.x86_64 7:7.1-1.0.5.el7 will be updated
---> Package oraclelinux-release.x86_64 7:7.6-1.0.15.el7 will be an update
--> Processing Conflict: systemd-219-62.0.4.el7_6.7.x86_64 conflicts dracut < 033-243
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package dracut.x86_64 0:033-240.0.1.el7 will be updated
--> Processing Dependency: dracut = 033-240.0.1.el7 for package: dracut-config-rescue-033-240.0.1.el7.x86_64
--> Processing Dependency: dracut = 033-240.0.1.el7 for package: dracut-network-033-240.0.1.el7.x86_64
---> Package dracut.x86_64 0:033-554.0.3.el7 will be an update
--> Running transaction check
---> Package dracut-config-rescue.x86_64 0:033-240.0.1.el7 will be updated
---> Package dracut-config-rescue.x86_64 0:033-554.0.3.el7 will be an update
---> Package dracut-network.x86_64 0:033-240.0.1.el7 will be updated
---> Package dracut-network.x86_64 0:033-554.0.3.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
 Package                                                            Arch                                        Version                                                               Repository                                       Size
============================================================================================================================================================================================================================================
Installing:
 docker-engine                                                      x86_64                                      18.09.1.ol-1.0.5.el7                                                  ol7_addons                                       19 M
Updating:
 dracut                                                             x86_64                                      033-554.0.3.el7                                                       ol7_latest                                      328 k
 initscripts                                                        x86_64                                      9.49.46-1.0.1.el7                                                     ol7_latest                                      439 k
 oraclelinux-release                                                x86_64                                      7:7.6-1.0.15.el7                                                      ol7_latest                                       54 k
 redhat-release-server                                              x86_64                                      1:7.6-4.0.1.el7                                                       ol7_latest                                      9.8 k
Installing for dependencies:
 container-selinux                                                  noarch                                      2:2.77-5.el7                                                          ol7_addons                                       37 k
 containerd                                                         x86_64                                      1.2.0-1.0.5.el7                                                       ol7_addons                                       21 M
 criu                                                               x86_64                                      3.9-5.el7                                                             ol7_latest                                      432 k
 docker-cli                                                         x86_64                                      18.09.1.ol-1.0.5.el7                                                  ol7_addons                                       14 M
 libnet                                                             x86_64                                      1.1.6-7.el7                                                           ol7_latest                                       57 k
 lz4                                                                x86_64                                      1.7.5-2.0.1.el7                                                       ol7_latest                                       98 k
 protobuf-c                                                         x86_64                                      1.0.2-3.el7                                                           ol7_latest                                       27 k
 runc                                                               x86_64                                      1.0.0-19.rc5.git4bb1fe4.0.3.el7                                       ol7_addons                                      1.9 M
Updating for dependencies:
 cryptsetup                                                         x86_64                                      2.0.3-3.el7                                                           ol7_latest                                      153 k
 cryptsetup-libs                                                    x86_64                                      2.0.3-3.el7                                                           ol7_latest                                      337 k
 cryptsetup-python                                                  x86_64                                      2.0.3-3.el7                                                           ol7_latest                                       35 k
 device-mapper                                                      x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      293 k
 device-mapper-event                                                x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      188 k
 device-mapper-event-libs                                           x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      188 k
 device-mapper-libs                                                 x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      320 k
 device-mapper-persistent-data                                      x86_64                                      0.7.3-3.el7                                                           ol7_latest                                      404 k
 dracut-config-rescue                                               x86_64                                      033-554.0.3.el7                                                       ol7_latest                                       60 k
 dracut-network                                                     x86_64                                      033-554.0.3.el7                                                       ol7_latest                                      102 k
 glib2                                                              x86_64                                      2.56.1-4.el7_6                                                        ol7_latest                                      2.5 M
 kmod                                                               x86_64                                      20-23.0.1.el7                                                         ol7_latest                                      121 k
 libgudev1                                                          x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                       96 k
 libnl3                                                             x86_64                                      3.2.28-4.el7                                                          ol7_latest                                      277 k
 libnl3-cli                                                         x86_64                                      3.2.28-4.el7                                                          ol7_latest                                      159 k
 libseccomp                                                         x86_64                                      2.3.1-3.el7                                                           ol7_latest                                       55 k
 libselinux                                                         x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      162 k
 libselinux-python                                                  x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      235 k
 libselinux-utils                                                   x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      151 k
 libsemanage                                                        x86_64                                      2.5-14.el7                                                            ol7_latest                                      150 k
 libsemanage-python                                                 x86_64                                      2.5-14.el7                                                            ol7_latest                                      112 k
 libsepol                                                           x86_64                                      2.5-10.el7                                                            ol7_latest                                      297 k
 lvm2                                                               x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      1.3 M
 lvm2-libs                                                          x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      1.1 M
 lvm2-python-libs                                                   x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      186 k
 policycoreutils                                                    x86_64                                      2.5-29.0.1.el7_6.1                                                    ol7_latest                                      916 k
 policycoreutils-python                                             x86_64                                      2.5-29.0.1.el7_6.1                                                    ol7_latest                                      455 k
 selinux-policy                                                     noarch                                      3.13.1-229.0.3.el7_6.12                                               ol7_latest                                      484 k
 selinux-policy-targeted                                            noarch                                      3.13.1-229.0.3.el7_6.12                                               ol7_latest                                      6.9 M
 setools-libs                                                       x86_64                                      3.3.8-4.el7                                                           ol7_latest                                      620 k
 systemd                                                            x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      5.1 M
 systemd-libs                                                       x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      407 k
 systemd-python                                                     x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      133 k
 systemd-sysv                                                       x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                       84 k

Transaction Summary
============================================================================================================================================================================================================================================
Install  1 Package  (+ 8 Dependent packages)
Upgrade  4 Packages (+34 Dependent packages)

Total download size: 81 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/cryptsetup-2.0.3-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY                                                      ] 373 kB/s | 1.6 MB  00:03:39 ETA
Public key for cryptsetup-2.0.3-3.el7.x86_64.rpm is not installed
(1/47): cryptsetup-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                            | 153 kB  00:00:04
(2/47): criu-3.9-5.el7.x86_64.rpm                                                                                                                                                                                    | 432 kB  00:00:04
Public key for container-selinux-2.77-5.el7.noarch.rpm is not installed
(3/47): container-selinux-2.77-5.el7.noarch.rpm                                                                                                                                                                      |  37 kB  00:00:04
(4/47): cryptsetup-python-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                     |  35 kB  00:00:00
(5/47): cryptsetup-libs-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                       | 337 kB  00:00:01
(6/47): device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                       | 188 kB  00:00:00
(7/47): device-mapper-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                             | 293 kB  00:00:01
(8/47): device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                  | 188 kB  00:00:00
(9/47): device-mapper-persistent-data-0.7.3-3.el7.x86_64.rpm                                                                                                                                                         | 404 kB  00:00:00
(10/47): device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                       | 320 kB  00:00:02
(11/47): containerd-1.2.0-1.0.5.el7.x86_64.rpm                                                                                                                                                                       |  21 MB  00:00:13
(12/47): dracut-config-rescue-033-554.0.3.el7.x86_64.rpm                                                                                                                                                             |  60 kB  00:00:01
(13/47): dracut-network-033-554.0.3.el7.x86_64.rpm                                                                                                                                                                   | 102 kB  00:00:00
(14/47): dracut-033-554.0.3.el7.x86_64.rpm                                                                                                                                                                           | 328 kB  00:00:02
(15/47): initscripts-9.49.46-1.0.1.el7.x86_64.rpm                                                                                                                                                                    | 439 kB  00:00:00
(16/47): kmod-20-23.0.1.el7.x86_64.rpm                                                                                                                                                                               | 121 kB  00:00:00
(17/47): libgudev1-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                     |  96 kB  00:00:00
(18/47): glib2-2.56.1-4.el7_6.x86_64.rpm                                                                                                                                                                             | 2.5 MB  00:00:02
(19/47): libnl3-3.2.28-4.el7.x86_64.rpm                                                                                                                                                                              | 277 kB  00:00:00
(20/47): docker-cli-18.09.1.ol-1.0.5.el7.x86_64.rpm                                                                                                                                                                  |  14 MB  00:00:12
(21/47): libnet-1.1.6-7.el7.x86_64.rpm                                                                                                                                                                               |  57 kB  00:00:01
(22/47): libseccomp-2.3.1-3.el7.x86_64.rpm                                                                                                                                                                           |  55 kB  00:00:00
(23/47): libselinux-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                          | 162 kB  00:00:00
(24/47): libnl3-cli-3.2.28-4.el7.x86_64.rpm                                                                                                                                                                          | 159 kB  00:00:00
(25/47): libselinux-python-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                   | 235 kB  00:00:00
(26/47): libselinux-utils-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                    | 151 kB  00:00:00
(27/47): libsemanage-python-2.5-14.el7.x86_64.rpm                                                                                                                                                                    | 112 kB  00:00:00
(28/47): libsemanage-2.5-14.el7.x86_64.rpm                                                                                                                                                                           | 150 kB  00:00:00
(29/47): libsepol-2.5-10.el7.x86_64.rpm                                                                                                                                                                              | 297 kB  00:00:00
(30/47): lvm2-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                                     | 1.3 MB  00:00:00
(31/47): lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                         | 186 kB  00:00:00
(32/47): lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                                | 1.1 MB  00:00:01
(33/47): lz4-1.7.5-2.0.1.el7.x86_64.rpm                                                                                                                                                                              |  98 kB  00:00:00
(34/47): oraclelinux-release-7.6-1.0.15.el7.x86_64.rpm                                                                                                                                                               |  54 kB  00:00:00
(35/47): policycoreutils-2.5-29.0.1.el7_6.1.x86_64.rpm                                                                                                                                                               | 916 kB  00:00:00
(36/47): policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64.rpm                                                                                                                                                        | 455 kB  00:00:00
(37/47): redhat-release-server-7.6-4.0.1.el7.x86_64.rpm                                                                                                                                                              | 9.8 kB  00:00:00
(38/47): docker-engine-18.09.1.ol-1.0.5.el7.x86_64.rpm                                                                                                                                                               |  19 MB  00:00:10
(39/47): selinux-policy-3.13.1-229.0.3.el7_6.12.noarch.rpm                                                                                                                                                           | 484 kB  00:00:00
(40/47): protobuf-c-1.0.2-3.el7.x86_64.rpm                                                                                                                                                                           |  27 kB  00:00:02
(41/47): setools-libs-3.3.8-4.el7.x86_64.rpm                                                                                                                                                                         | 620 kB  00:00:00
(42/47): runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64.rpm                                                                                                                                                             | 1.9 MB  00:00:04
(43/47): selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch.rpm                                                                                                                                                  | 6.9 MB  00:00:03
(44/47): systemd-libs-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                  | 407 kB  00:00:00
(45/47): systemd-python-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                | 133 kB  00:00:00
(46/47): systemd-sysv-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                  |  84 kB  00:00:00
(47/47): systemd-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                       | 5.1 MB  00:00:04
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       2.8 MB/s |  81 MB  00:00:29
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) "
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 Package    : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64 (@anaconda/7.1)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libsepol-2.5-10.el7.x86_64                                                                                                                                                                                              1/85
  Updating   : libselinux-2.5-14.1.el7.x86_64                                                                                                                                                                                          2/85
  Updating   : libsemanage-2.5-14.el7.x86_64                                                                                                                                                                                           3/85
  Installing : lz4-1.7.5-2.0.1.el7.x86_64                                                                                                                                                                                              4/85
  Updating   : systemd-libs-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                  5/85
  Updating   : 1:redhat-release-server-7.6-4.0.1.el7.x86_64                                                                                                                                                                            6/85
  Updating   : cryptsetup-libs-2.0.3-3.el7.x86_64                                                                                                                                                                                      7/85
  Updating   : 7:device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                     8/85
  Updating   : 7:device-mapper-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                          9/85
  Updating   : systemd-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                      10/85
  Updating   : dracut-033-554.0.3.el7.x86_64                                                                                                                                                                                          11/85
  Updating   : kmod-20-23.0.1.el7.x86_64                                                                                                                                                                                              12/85
  Updating   : 7:device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                              13/85
  Updating   : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                                                          14/85
  Updating   : glib2-2.56.1-4.el7_6.x86_64                                                                                                                                                                                            15/85
  Updating   : libselinux-utils-2.5-14.1.el7.x86_64                                                                                                                                                                                   16/85
  Updating   : policycoreutils-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                              17/85
  Updating   : selinux-policy-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                          18/85
  Updating   : libnl3-3.2.28-4.el7.x86_64                                                                                                                                                                                             19/85
  Updating   : selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                 20/85
  Updating   : 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                   21/85
  Updating   : 7:lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                             22/85
  Updating   : 7:oraclelinux-release-7.6-1.0.15.el7.x86_64                                                                                                                                                                            23/85
  Updating   : libsemanage-python-2.5-14.el7.x86_64                                                                                                                                                                                   24/85
  Updating   : libselinux-python-2.5-14.1.el7.x86_64                                                                                                                                                                                  25/85
  Updating   : setools-libs-3.3.8-4.el7.x86_64                                                                                                                                                                                        26/85
  Updating   : policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                       27/85
  Installing : 2:container-selinux-2.77-5.el7.noarch                                                                                                                                                                                  28/85
  Installing : containerd-1.2.0-1.0.5.el7.x86_64                                                                                                                                                                                      29/85
  Installing : docker-cli-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                                 30/85
  Installing : libnet-1.1.6-7.el7.x86_64                                                                                                                                                                                              31/85
  Installing : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                          32/85
  Installing : criu-3.9-5.el7.x86_64                                                                                                                                                                                                  33/85
  Installing : runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64                                                                                                                                                                            34/85
  Updating   : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                                                                                                                                       35/85
  Updating   : 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                                  36/85
Created symlink from /etc/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket to /usr/lib/systemd/system/lvm2-lvmpolld.socket.
  Installing : docker-engine-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                              37/85
  Updating   : initscripts-9.49.46-1.0.1.el7.x86_64                                                                                                                                                                                   38/85
  Updating   : 7:lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                      39/85
  Updating   : libnl3-cli-3.2.28-4.el7.x86_64                                                                                                                                                                                         40/85
  Updating   : libgudev1-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                    41/85
  Updating   : dracut-network-033-554.0.3.el7.x86_64                                                                                                                                                                                  42/85
  Updating   : dracut-config-rescue-033-554.0.3.el7.x86_64                                                                                                                                                                            43/85
  Updating   : systemd-sysv-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 44/85
  Updating   : systemd-python-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                               45/85
  Updating   : cryptsetup-python-2.0.3-3.el7.x86_64                                                                                                                                                                                   46/85
  Updating   : cryptsetup-2.0.3-3.el7.x86_64                                                                                                                                                                                          47/85
  Cleanup    : 7:lvm2-2.02.115-3.el7.x86_64                                                                                                                                                                                           48/85
  Cleanup    : policycoreutils-python-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                         49/85

UPGRADE: Automatically re-enabling default systemd units:
        brandbot.path
        rhel-autorelabel.service
        rhel-autorelabel-mark.service
        rhel-configure.service
        rhel-dmesg.service
        rhel-domainname.service
        rhel-import-state.service
        rhel-loadmodules.service
        rhel-readonly.service

  Cleanup    : initscripts-9.49.24-1.0.1.el7.x86_64                                                                                                                                                                                   50/85
  Cleanup    : libgudev1-208-20.0.1.el7.x86_64                                                                                                                                                                                        51/85
  Cleanup    : selinux-policy-targeted-3.13.1-23.0.1.el7.noarch                                                                                                                                                                       52/85
  Cleanup    : selinux-policy-3.13.1-23.0.1.el7.noarch                                                                                                                                                                                53/85
  Cleanup    : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64                                                                                                                                                                             54/85
  Cleanup    : dracut-config-rescue-033-240.0.1.el7.x86_64                                                                                                                                                                            55/85
  Cleanup    : systemd-sysv-208-20.0.1.el7.x86_64                                                                                                                                                                                     56/85
  Cleanup    : dracut-network-033-240.0.1.el7.x86_64                                                                                                                                                                                  57/85
  Cleanup    : policycoreutils-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                                58/85
  Cleanup    : systemd-python-208-20.0.1.el7.x86_64                                                                                                                                                                                   59/85
  Cleanup    : dracut-033-240.0.1.el7.x86_64                                                                                                                                                                                          60/85
  Cleanup    : setools-libs-3.3.7-46.el7.x86_64                                                                                                                                                                                       61/85
  Cleanup    : libselinux-utils-2.2.2-6.el7.x86_64                                                                                                                                                                                    62/85
  Cleanup    : glib2-2.40.0-4.el7.x86_64                                                                                                                                                                                              63/85
  Cleanup    : libselinux-python-2.2.2-6.el7.x86_64                                                                                                                                                                                   64/85
  Cleanup    : libsemanage-python-2.1.10-16.el7.x86_64                                                                                                                                                                                65/85
  Cleanup    : libsemanage-2.1.10-16.el7.x86_64                                                                                                                                                                                       66/85
  Cleanup    : cryptsetup-1.6.6-3.el7.x86_64                                                                                                                                                                                          67/85
  Cleanup    : libnl3-cli-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                     68/85
  Cleanup    : cryptsetup-python-1.6.6-3.el7.x86_64                                                                                                                                                                                   69/85
  Cleanup    : 7:lvm2-python-libs-2.02.115-3.el7.x86_64                                                                                                                                                                               70/85
  Cleanup    : 7:lvm2-libs-2.02.115-3.el7.x86_64                                                                                                                                                                                      71/85
  Cleanup    : 7:device-mapper-event-1.02.93-3.el7.x86_64                                                                                                                                                                             72/85
  Cleanup    : 7:device-mapper-event-libs-1.02.93-3.el7.x86_64                                                                                                                                                                        73/85
  Cleanup    : cryptsetup-libs-1.6.6-3.el7.x86_64                                                                                                                                                                                     74/85
  Cleanup    : systemd-208-20.0.1.el7.x86_64                                                                                                                                                                                          75/85
  Cleanup    : 7:device-mapper-1.02.93-3.el7.x86_64                                                                                                                                                                                   76/85
  Cleanup    : 7:device-mapper-libs-1.02.93-3.el7.x86_64                                                                                                                                                                              77/85
  Cleanup    : 1:redhat-release-server-7.1-1.0.2.el7.x86_64                                                                                                                                                                           78/85
  Cleanup    : systemd-libs-208-20.0.1.el7.x86_64                                                                                                                                                                                     79/85
  Cleanup    : libselinux-2.2.2-6.el7.x86_64                                                                                                                                                                                          80/85
  Cleanup    : libsepol-2.1.9-3.el7.x86_64                                                                                                                                                                                            81/85
  Cleanup    : kmod-14-10.el7.x86_64                                                                                                                                                                                                  82/85
  Cleanup    : libnl3-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                         83/85
  Cleanup    : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                                                                                                                                                       84/85
  Cleanup    : libseccomp-2.1.1-2.el7.x86_64                                                                                                                                                                                          85/85
  Verifying  : 7:device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                               1/85
  Verifying  : glib2-2.56.1-4.el7_6.x86_64                                                                                                                                                                                             2/85
  Verifying  : docker-engine-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                               3/85
  Verifying  : policycoreutils-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                               4/85
  Verifying  : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                                                           5/85
  Verifying  : kmod-20-23.0.1.el7.x86_64                                                                                                                                                                                               6/85
  Verifying  : 7:device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                     7/85
  Verifying  : 7:lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                       8/85
  Verifying  : libgudev1-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                     9/85
  Verifying  : cryptsetup-libs-2.0.3-3.el7.x86_64                                                                                                                                                                                     10/85
  Verifying  : selinux-policy-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                          11/85
  Verifying  : 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                                  12/85
  Verifying  : 2:container-selinux-2.77-5.el7.noarch                                                                                                                                                                                  13/85
  Verifying  : initscripts-9.49.46-1.0.1.el7.x86_64                                                                                                                                                                                   14/85
  Verifying  : cryptsetup-python-2.0.3-3.el7.x86_64                                                                                                                                                                                   15/85
  Verifying  : libsemanage-python-2.5-14.el7.x86_64                                                                                                                                                                                   16/85
  Verifying  : 1:redhat-release-server-7.6-4.0.1.el7.x86_64                                                                                                                                                                           17/85
  Verifying  : 7:oraclelinux-release-7.6-1.0.15.el7.x86_64                                                                                                                                                                            18/85
  Verifying  : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                                                                                                                                       19/85
  Verifying  : dracut-network-033-554.0.3.el7.x86_64                                                                                                                                                                                  20/85
  Verifying  : systemd-sysv-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 21/85
  Verifying  : containerd-1.2.0-1.0.5.el7.x86_64                                                                                                                                                                                      22/85
  Verifying  : policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                       23/85
  Verifying  : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                          24/85
  Verifying  : dracut-config-rescue-033-554.0.3.el7.x86_64                                                                                                                                                                            25/85
  Verifying  : libselinux-2.5-14.1.el7.x86_64                                                                                                                                                                                         26/85
  Verifying  : systemd-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                      27/85
  Verifying  : criu-3.9-5.el7.x86_64                                                                                                                                                                                                  28/85
  Verifying  : libsemanage-2.5-14.el7.x86_64                                                                                                                                                                                          29/85
  Verifying  : systemd-libs-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 30/85
  Verifying  : libnl3-cli-3.2.28-4.el7.x86_64                                                                                                                                                                                         31/85
  Verifying  : systemd-python-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                               32/85
  Verifying  : libselinux-python-2.5-14.1.el7.x86_64                                                                                                                                                                                  33/85
  Verifying  : libnet-1.1.6-7.el7.x86_64                                                                                                                                                                                              34/85
  Verifying  : libsepol-2.5-10.el7.x86_64                                                                                                                                                                                             35/85
  Verifying  : runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64                                                                                                                                                                            36/85
  Verifying  : selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                 37/85
  Verifying  : libselinux-utils-2.5-14.1.el7.x86_64                                                                                                                                                                                   38/85
  Verifying  : dracut-033-554.0.3.el7.x86_64                                                                                                                                                                                          39/85
  Verifying  : 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                   40/85
  Verifying  : 7:device-mapper-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                         41/85
  Verifying  : libnl3-3.2.28-4.el7.x86_64                                                                                                                                                                                             42/85
  Verifying  : docker-cli-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                                 43/85
  Verifying  : 7:lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                             44/85
  Verifying  : setools-libs-3.3.8-4.el7.x86_64                                                                                                                                                                                        45/85
  Verifying  : lz4-1.7.5-2.0.1.el7.x86_64                                                                                                                                                                                             46/85
  Verifying  : cryptsetup-2.0.3-3.el7.x86_64                                                                                                                                                                                          47/85
  Verifying  : libselinux-utils-2.2.2-6.el7.x86_64                                                                                                                                                                                    48/85
  Verifying  : libsemanage-python-2.1.10-16.el7.x86_64                                                                                                                                                                                49/85
  Verifying  : dracut-config-rescue-033-240.0.1.el7.x86_64                                                                                                                                                                            50/85
  Verifying  : systemd-libs-208-20.0.1.el7.x86_64                                                                                                                                                                                     51/85
  Verifying  : systemd-sysv-208-20.0.1.el7.x86_64                                                                                                                                                                                     52/85
  Verifying  : policycoreutils-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                                53/85
  Verifying  : policycoreutils-python-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                         54/85
  Verifying  : cryptsetup-python-1.6.6-3.el7.x86_64                                                                                                                                                                                   55/85
  Verifying  : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64                                                                                                                                                                             56/85
  Verifying  : 7:device-mapper-event-libs-1.02.93-3.el7.x86_64                                                                                                                                                                        57/85
  Verifying  : dracut-033-240.0.1.el7.x86_64                                                                                                                                                                                          58/85
  Verifying  : cryptsetup-1.6.6-3.el7.x86_64                                                                                                                                                                                          59/85
  Verifying  : setools-libs-3.3.7-46.el7.x86_64                                                                                                                                                                                       60/85
  Verifying  : initscripts-9.49.24-1.0.1.el7.x86_64                                                                                                                                                                                   61/85
  Verifying  : kmod-14-10.el7.x86_64                                                                                                                                                                                                  62/85
  Verifying  : systemd-python-208-20.0.1.el7.x86_64                                                                                                                                                                                   63/85
  Verifying  : cryptsetup-libs-1.6.6-3.el7.x86_64                                                                                                                                                                                     64/85
  Verifying  : dracut-network-033-240.0.1.el7.x86_64                                                                                                                                                                                  65/85
  Verifying  : glib2-2.40.0-4.el7.x86_64                                                                                                                                                                                              66/85
  Verifying  : libnl3-cli-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                     67/85
  Verifying  : libnl3-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                         68/85
  Verifying  : 7:device-mapper-event-1.02.93-3.el7.x86_64                                                                                                                                                                             69/85
  Verifying  : libselinux-python-2.2.2-6.el7.x86_64                                                                                                                                                                                   70/85
  Verifying  : libsemanage-2.1.10-16.el7.x86_64                                                                                                                                                                                       71/85
  Verifying  : libseccomp-2.1.1-2.el7.x86_64                                                                                                                                                                                          72/85
  Verifying  : libsepol-2.1.9-3.el7.x86_64                                                                                                                                                                                            73/85
  Verifying  : 7:lvm2-python-libs-2.02.115-3.el7.x86_64                                                                                                                                                                               74/85
  Verifying  : 7:device-mapper-1.02.93-3.el7.x86_64                                                                                                                                                                                   75/85
  Verifying  : selinux-policy-3.13.1-23.0.1.el7.noarch                                                                                                                                                                                76/85
  Verifying  : libselinux-2.2.2-6.el7.x86_64                                                                                                                                                                                          77/85
  Verifying  : 1:redhat-release-server-7.1-1.0.2.el7.x86_64                                                                                                                                                                           78/85
  Verifying  : libgudev1-208-20.0.1.el7.x86_64                                                                                                                                                                                        79/85
  Verifying  : 7:lvm2-2.02.115-3.el7.x86_64                                                                                                                                                                                           80/85
  Verifying  : 7:lvm2-libs-2.02.115-3.el7.x86_64                                                                                                                                                                                      81/85
  Verifying  : 7:device-mapper-libs-1.02.93-3.el7.x86_64                                                                                                                                                                              82/85
  Verifying  : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                                                                                                                                                       83/85
  Verifying  : selinux-policy-targeted-3.13.1-23.0.1.el7.noarch                                                                                                                                                                       84/85
  Verifying  : systemd-208-20.0.1.el7.x86_64                                                                                                                                                                                          85/85

Installed:
  docker-engine.x86_64 0:18.09.1.ol-1.0.5.el7

Dependency Installed:
  container-selinux.noarch 2:2.77-5.el7     containerd.x86_64 0:1.2.0-1.0.5.el7               criu.x86_64 0:3.9-5.el7     docker-cli.x86_64 0:18.09.1.ol-1.0.5.el7     libnet.x86_64 0:1.1.6-7.el7     lz4.x86_64 0:1.7.5-2.0.1.el7
  protobuf-c.x86_64 0:1.0.2-3.el7           runc.x86_64 0:1.0.0-19.rc5.git4bb1fe4.0.3.el7

Updated:
  dracut.x86_64 0:033-554.0.3.el7                   initscripts.x86_64 0:9.49.46-1.0.1.el7                   oraclelinux-release.x86_64 7:7.6-1.0.15.el7                   redhat-release-server.x86_64 1:7.6-4.0.1.el7

Dependency Updated:
  cryptsetup.x86_64 0:2.0.3-3.el7                              cryptsetup-libs.x86_64 0:2.0.3-3.el7                          cryptsetup-python.x86_64 0:2.0.3-3.el7                  device-mapper.x86_64 7:1.02.149-10.0.3.el7_6.8
  device-mapper-event.x86_64 7:1.02.149-10.0.3.el7_6.8         device-mapper-event-libs.x86_64 7:1.02.149-10.0.3.el7_6.8     device-mapper-libs.x86_64 7:1.02.149-10.0.3.el7_6.8     device-mapper-persistent-data.x86_64 0:0.7.3-3.el7
  dracut-config-rescue.x86_64 0:033-554.0.3.el7                dracut-network.x86_64 0:033-554.0.3.el7                       glib2.x86_64 0:2.56.1-4.el7_6                           kmod.x86_64 0:20-23.0.1.el7
  libgudev1.x86_64 0:219-62.0.4.el7_6.7                        libnl3.x86_64 0:3.2.28-4.el7                                  libnl3-cli.x86_64 0:3.2.28-4.el7                        libseccomp.x86_64 0:2.3.1-3.el7
  libselinux.x86_64 0:2.5-14.1.el7                             libselinux-python.x86_64 0:2.5-14.1.el7                       libselinux-utils.x86_64 0:2.5-14.1.el7                  libsemanage.x86_64 0:2.5-14.el7
  libsemanage-python.x86_64 0:2.5-14.el7                       libsepol.x86_64 0:2.5-10.el7                                  lvm2.x86_64 7:2.02.180-10.0.3.el7_6.8                   lvm2-libs.x86_64 7:2.02.180-10.0.3.el7_6.8
  lvm2-python-libs.x86_64 7:2.02.180-10.0.3.el7_6.8            policycoreutils.x86_64 0:2.5-29.0.1.el7_6.1                   policycoreutils-python.x86_64 0:2.5-29.0.1.el7_6.1      selinux-policy.noarch 0:3.13.1-229.0.3.el7_6.12
  selinux-policy-targeted.noarch 0:3.13.1-229.0.3.el7_6.12     setools-libs.x86_64 0:3.3.8-4.el7                             systemd.x86_64 0:219-62.0.4.el7_6.7                     systemd-libs.x86_64 0:219-62.0.4.el7_6.7
  systemd-python.x86_64 0:219-62.0.4.el7_6.7                   systemd-sysv.x86_64 0:219-62.0.4.el7_6.7

Complete!

一旦安装完成,就可以启动docker服务

[root@localhost soft]# service docker start
Redirecting to /bin/systemctl start docker.service

[root@localhost soft]# systemctl enable docker

[root@localhost soft]# service docker status
Redirecting to /bin/systemctl status docker.service
鈼[0m docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           鈹斺攢docker-sysconfig.conf
   Active: active (running) since Mon 2019-06-10 23:15:05 CST; 6h left
     Docs: https://docs.docker.com
 Main PID: 1452 (dockerd)
   Memory: 132.2M
   CGroup: /system.slice/docker.service
           鈹溾攢1452 /usr/bin/dockerd --selinux-enabled --storage-driver devicemapper --storage-opt dm.basesize=25G
           鈹斺攢2436 containerd --config /var/run/docker/containerd/containerd.toml --log-level info

Jun 10 23:15:03 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:03.843382248+08:00" level=info msg="Successfully created filesystem xfs on device docker-253:0-1047242-base" storage-driver=devicemapper
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.076789613+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.078665673+08:00" level=warning msg="mountpoint for pids not found"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.079906275+08:00" level=info msg="Loading containers: start."
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.554467519+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to...rred IP address"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.859786800+08:00" level=info msg="Loading containers: done."
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.959099871+08:00" level=info msg="Docker daemon" commit=c3ab8a8 graphdriver(s)=devicemapper version=18.09.1-ol
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.959938124+08:00" level=info msg="Daemon has completed initialization"
Jun 10 23:15:05 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:05.053166130+08:00" level=info msg="API listen on /var/run/docker.sock"
Jun 10 23:15:05 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.

然后可以下载镜像文件

[root@localhost soft]# docker pull mysql/mysql-server:5.7
Trying to pull repository docker.io/mysql/mysql-server ...
5.7: Pulling from docker.io/mysql/mysql-server
35defbf6c365: Pull complete
0fa46ab0f51d: Pull complete
f70f5000008c: Pull complete
892ac46af8c0: Pull complete
Digest: sha256:ddb046076781a15200d36cb01f8f512431c3481bedebd5e92646d8c617ae212c
Status: Downloaded newer image for mysql/mysql-server:5.7
[root@localhost soft]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
mysql/mysql-server   5.7                 857eadf53a54        6 weeks ago         258MB



使用Docker来部署MySQL
下载MySQL Server Docker镜像文件
严格来说,不需要在单独的步骤中下载服务器镜像,但是,在创建Docker容器之前执行此步骤可以确保本地映像是最新的。为了下载MySQL社区版镜像,执行以下命令:

docker pull mysql/mysql-server:tag

tag是你想要pull镜像版本的标识(例如,5.5,5.6,5.7,8.0或最新版本)。如果:tag被忽略,latest标记会被使用并且最新通用可用版本的MySQL社区版本镜像将会被下载。网址
https://hub.docker.com/r/mysql/mysql-server/tags/列出了所有可用版本信息.

[root@localhost soft]# docker pull mysql/mysql-server:5.7
Trying to pull repository docker.io/mysql/mysql-server ...
5.7: Pulling from docker.io/mysql/mysql-server
35defbf6c365: Pull complete
0fa46ab0f51d: Pull complete
f70f5000008c: Pull complete
892ac46af8c0: Pull complete
Digest: sha256:ddb046076781a15200d36cb01f8f512431c3481bedebd5e92646d8c617ae212c
Status: Downloaded newer image for mysql/mysql-server:5.7

如果要显示Docker镜像可以执行以下命令:

[root@localhost soft]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
mysql/mysql-server   5.7                 857eadf53a54        6 weeks ago         258MB

为了下载MySQL企业版本镜像,执行以下命令:

docker pull store/oracle/mysql-enterprise-server:5.7

5.7是我们想要pull的镜像版本。MySQL企业版本容器只提供了最新的通用可用版本5.7

启动MySQL Server实例
为MySQL社区版本服务器启动一个新的Docker容器执行以下命令:

[root@localhost ~]# docker run --name=mysql1 -d mysql/mysql-server:5.7
5128014e440f10c557b52e6203445a01c97728e432d0f231c6027bf4b15520bd

为MySQL企业版本服务器启动一个新的Docker容器执行以下命令:

docker run --name=mysql1 -d store/oracle/mysql-enterprise-server:tag

–name选项,用来为你的服务容器指定名字(例如mysql1),它是可选项。如果没有提供容器名,会生成一个随机容器名。如果之前的docker pull或docker run命令所指定名称或标记的Docker镜像没有下载,那么镜像现在就会被下载。在下载完成后,开始初始化容器,并且当你执行docker ps命令时容器会出现在正在运行的容器列表中。例如:

[root@localhost ~]# docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                             PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysq鈥   42 seconds ago      Up 39 seconds (health: starting)   3306/tcp, 33060/tcp   mysql1

IMAGE列的输出对于MySQL社区版本读取的值为mysql/mysql-server,对于MySQL企业版本读取的值为store/oracle/mysql-enterprise-server。
容器初始化可能会花费一些时间。当服务准备好使用时,docker ps命令输出的STATUS列将从(health: starting)改变为(healthy)。

在上面的docker run命令中-d选项使容器在后台运行。使用下面的命令可以监控容器的输出信息:

[root@localhost ~]# docker logs mysql1
[Entrypoint] MySQL Docker Image 5.7.26-1.1.11
[Entrypoint] No password option specified for new database.
[Entrypoint]   A random onetime password will be generated.
[Entrypoint] Initializing database
[Entrypoint] Database initialized
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
[Entrypoint] GENERATED ROOT PASSWORD: 3z[omLAk4Jaz@sYxDiLYnyPySYfR

[Entrypoint] ignoring /docker-entrypoint-initdb.d/*

[Entrypoint] Server shut down
[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used.

[Entrypoint] MySQL init process done. Ready for start up.

[Entrypoint] Starting MySQL 5.7.26-1.1.11

一旦初始化完成,命令的输出将会包含为root用户生成随机密码的信息,也可以执行下面的命令来检查密码:

[root@localhost ~]# docker logs mysql1 2>&1 | grep GENERATED
[Entrypoint] GENERATED ROOT PASSWORD: 3z[omLAk4Jaz@sYxDiLYnyPySYfR

在容器中连接MySQL服务器
一旦服务可以使用后,可以在刚刚启动的MySQL服务容器中运行mysql客户端程序并连接到MySQL服务。在刚刚启动的Docker容器中使用docker exec -it命令来启动mysql客户端程序,例如:

[root@localhost ~]# docker exec -it mysql1 mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 107
Server version: 5.7.26

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

在执行上面的命令时需要输入root用户生成的密码。因为mysql_onetime_password选项缺省情况为true(对于MySQL社区版本来说),在mysql客户端连接到MySQL服务后,必须要通过执行以下命令来修改root用户的密码:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)

一旦修改密码后,MySQL服务就可以使用。

容器Shell访问
为了使用shell访问你的MySQL服务器容器,在容器中使用docker exec -it命令来启动bash shell:

[root@localhost ~]# docker exec -it mysql1 bash
bash-4.2#

在启动bash shell后,在容器中可以运行linux命令,例如,为了查看容器中的MySQL数据库的数据目录中的内容,执行以下命令:

bash-4.2# ls /var/lib/mysql
auto.cnf    ca.pem           client-key.pem  ib_logfile0  ibdata1  mysql       mysql.sock.lock     private_key.pem  server-cert.pem  sys
ca-key.pem  client-cert.pem  ib_buffer_pool  ib_logfile1  ibtmp1   mysql.sock  performance_schema  public_key.pem   server-key.pem

停止与删除一个MySQL容器
为了停止已经创建的MySQL服务容器执行下面的命令:

[root@localhost ~]# docker stop mysql1
mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                     PORTS               NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   21 hours ago        Exited (0) 8 seconds ago                       mysql1

docker stop将发送一个SIGTERM信号给mysqld进程,因此服务将被优雅的关闭。
还可以观察到当一个容器的主进程(一个MySQL服务容器的主进程为mysqld)被关闭,Docker容器也会自动关闭。

启动MySQL服务容器:

[root@localhost ~]# docker start mysql1
mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                            PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   22 hours ago        Up 5 seconds (health: starting)   3306/tcp, 33060/tcp   mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                             PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   22 hours ago        Up 15 seconds (health: starting)   3306/tcp, 33060/tcp   mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                             PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   22 hours ago        Up 21 seconds (health: starting)   3306/tcp, 33060/tcp   mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                    PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   22 hours ago        Up 32 seconds (healthy)   3306/tcp, 33060/tcp   mysql1

为了使用单个命令停止与再次启动MySQL服务容器:

[root@localhost ~]# docker restart mysql1
mysql1
[root@localhost ~]# docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                            PORTS                 NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysql"   24 hours ago        Up 6 seconds (health: starting)   3306/tcp, 33060/tcp   mysql1

为了删除MySQL容器,首先停止容器,然后再使用docker rm命令:

[root@localhost ~]# docker stop mysql1
mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                      PORTS               NAMES
5128014e440f        mysql/mysql-server:5.7   "/entrypoint.sh mysq1"  24 hours ago        Exited (0) 12 seconds ago                       mysql1
[root@localhost ~]# docker rm mysql1
mysql1
[root@localhost ~]# docker ps -l
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

为Docker优化MySQL的安装
MySQL的Docker映像针对代码大小进行了优化,这意味着它们只包含与大多数在Docker容器中运行MySQL实例的用户相关的关键组件。一个MySQL Docker安装与常见的非Docker安装在以下方面不同:
包含的二进制文件是有限的:

/usr/bin/my_print_defaults
/usr/bin/mysql
/usr/bin/mysql_config
/usr/bin/mysql_install_db
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysql_upgrade
/usr/bin/mysqladmin
/usr/bin/mysqlcheck
/usr/bin/mysqldump
/usr/bin/mysqlpump
/usr/sbin/mysqld

所有的二进制文件被stripped;它们不包含调试信息。

配置MySQL Server
当你启动MySQL Docker容器时,可以通过docker run命令来传递配置选项给服务,例如,对于MySQL社区版本服务器

docker run --name mysql1 -d mysql/mysql-server:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_col

对于MySQL企业版本服务器:

docker run --name mysql1 -d store/oracle/mysql-enterprise-server --character-set-server=utf8mb4 --collation-server=utf8mb4_col

命令以utf8mb4作为默认字符集和utf8mb4col作为您的数据库的默认排序启动MySQL服务器。另一种配置MySQL服务器的方法是准备一个配置文件,并将其挂载到容器内的服务器配置文件的位置。有关详细信息,请参阅持久数据和配置更改。

持久数据和配置更改
Docker容器在原则上是临时的,如果容器被删除或损坏,任何数据或配置都将丢失(参见讨论)。然而,Docker卷提供了一种机制,可以在Docker容器中保存数据。在初始化时,MySQL服务器容器为服务器数据目录创建Docker卷。运行docker检查容器命令的JSON输出有一个挂载键,其值提供数据目录卷的信息:

[root@localhost ~]# docker inspect mysql1
...
"Mounts": [
            {
                "Type": "volume",
                "Name": "a74fb4e3348635ddc0b3eb32e3f82b4feb38eeadd8d5b3ae60b4389ab83a86d8",
                "Source": "/var/lib/docker/volumes/a74fb4e3348635ddc0b3eb32e3f82b4feb38eeadd8d5b3ae60b4389ab83a86d8/_data",
                "Destination": "/var/lib/mysql",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
...

输出显示源文件夹
/var/lib/docker/volumes/a74fb4e3348635ddc0b3eb32e3f82b4feb38eeadd8d5b3ae60b4389ab83a86d8/_data将数据持久化到主机上的数据,已经安装在/var/lib/mysql中,容器内的服务器数据目录。

保存数据的另一种方法是在创建容器时使用 –mount 选项挂载主机目录。同样的技术可以用来持久化服务器的配置。
下面的命令创建一个MySQL服务器容器,并将数据目录和服务器配置文件绑定在一起:

docker run --name=mysql1 \
--mount type=bind,src=/path-on-host-machine/my.cnf,dst=/etc/my.cnf \
--mount type=bind,src=/path-on-host-machine/datadir,dst=/var/lib/mysql \
-d mysql/mysql-server:tag

配置文件path-on-host-machine/my.cnf必须存在,同时包含指定的用户:

[mysqld]
user=mysql

path-on-host-machine.datadir目录必须存在。要发生服务器初始化,目录必须是空的。您还可以安装一个带有数据的目录,并使用它启动服务器;但是,您必须确保启动Docker容器,其配置与创建数据的服务器具有相同的配置,并且启动容器时所需的任何主机文件或目录都被安装。

运行额外的初始化脚本
如果您想在创建后立即在数据库上运行任何.sh或.sql脚本,您可以将它们放入主机目录中,然后mount目录在/docker-entrypoint-initdb.d

docker run --name=mysql1 \
--mount type=bind,src=/path-on-host-machine/scripts/,dst=/docker-entrypoint-initdb.d/ \
-d mysql/mysql-server:tag

对于MySQL企业版本服务器容器:

docker run --name=mysql1 \
--mount type=bind,src=/path-on-host-machine/scripts/,dst=/docker-entrypoint-initdb.d/ \
-d store/oracle/mysql-enterprise-server:tag

从另一个Docker容器中的应用程序连接到MySQL
通过建立一个Docker网络,你可以让多个Docker容器相互通信,这样,在另一个Docker容器中的客户端应用程序就可以在服务器容器中访问MySQL服务器。首先,创建一个Docker网络:

docker network create my-custom-net

然后,当您创建并启动服务器和客户端容器时,使用-network选项将它们放在您创建的网络上。例如:

docker run --name=mysql1 --network=my-custom-net -d mysql/mysql-server
docker run --name=myapp1 --network=my-custom-net -d myapp

当使用MySQL企业版本服务器容器:

docker run --name=mysql1 --network=my-custom-net -d store/oracle/mysql-enterprise-server
docker run --name=myapp1 --network=my-custom-net -d myapp

myapp1容器随后可以与mysql1主机连接到mysql1容器,反之亦然,因为Docker会自动为给定的容器名称设置一个DNS。在下面的例子中,我们从myapp1容器中运行mysql客户端,以便在自己的容器中连接主机mysql1:

docker exec -it myapp1 mysql --host=mysql1 --user=myuser --password

windows 7 vs 2013编译与安装MySQL 5.7

操作环境准备
1.在Win7上安装好Visual Studio 2013
2.下载MySQL 5.7.25源代码
3.安装CMake https://cmake.org/ 安装的时候,选择在PATH中加入
4.安装Bison: http://gnuwin32.sourceforge.net/packages/bison.htm 安装路径不要有空格
5.安装perl tool:ActivePerl-5.16.3.1604-MSWin32-x64-298023.msi

为了验证成功,可以执行以下命令:

C:\Users\Administrator>where bison
C:\GnuWin32\bin\bison.exe

C:\Users\Administrator>where cmake
C:\CMake\bin\cmake.exe

C:\Users\Administrator>where perl
C:\Perl64\bin\perl.exe

如果出现找不到,那就自己加path就行了

编译操作如下:
1. MySQL5.7.25的源文件存放在D:\Code_workspace\mysql-5.7.25目录下

D:\Code_workspace\mysql-5.7.25>dir
 驱动器 D 中的卷是 软件
 卷的序列号是 5D84-49C8

 D:\Code_workspace\mysql-5.7.25 的目录

2018-12-21  11:52              .
2018-12-21  11:52              ..
2018-12-21  11:52              BUILD
2018-12-21  11:52              client
2018-12-21  11:52              cmake
2018-12-21  11:39            27,753 CMakeLists.txt
2018-12-21  11:52              cmd-line-utils
2018-12-21  11:39            13,900 config.h.cmake
2018-12-21  11:39            25,850 configure.cmake
2018-12-21  11:39            17,987 COPYING
2018-12-21  11:52              dbug
2018-12-21  11:52              Docs
2018-12-21  11:39            66,241 Doxyfile-perfschema
2018-12-21  11:52              extra
2018-12-21  11:52              include
2018-12-21  11:39               333 INSTALL
2018-12-21  11:52              libbinlogevents
2018-12-21  11:52              libbinlogstandalone
2018-12-21  11:52              libevent
2018-12-21  11:52              libmysql
2018-12-21  11:52              libmysqld
2018-12-21  11:52              libservices
2018-12-21  11:52              man
2018-12-21  11:52              mysql-test
2018-12-21  11:52              mysys
2018-12-21  11:52              mysys_ssl
2018-12-21  11:52              packaging
2018-12-21  11:52              plugin
2018-12-21  11:52              rapid
2018-12-21  11:39             2,478 README
2018-12-21  11:52              regex
2018-12-21  11:52              scripts
2018-12-21  11:52              sql
2018-12-21  11:52              sql-common
2018-12-21  11:52              storage
2018-12-21  11:52              strings
2018-12-21  11:52              support-files
2018-12-21  11:52              testclients
2018-12-21  11:52              unittest
2018-12-21  11:39                88 VERSION
2018-12-21  11:52              vio
2018-12-21  11:52              win
2018-12-21  11:52              zlib
               8 个文件        154,630 字节
              35 个目录 18,364,108,800 可用字节

2.将boost文件存放在D:\Code_workspace\boost_1_59_0目录下

3.创建BLD文件夹并进入该文件夹。

D:\Code_workspace\mysql-5.7.25>mkdir BLD

D:\Code_workspace\mysql-5.7.25>cd BLD

D:\Code_workspace\mysql-5.7.25\BLD>

4.执行下面的命令,会下载boost文件夹,并在BLD文件夹下创建相关的项目文件:

D:\Code_workspace\mysql-5.7.25\BLD>cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST="D:\Code_workspace\boost_1_59_0"
-- Building for: Visual Studio 12 2013
CMake Deprecation Warning at CMakeLists.txt:28 (CMAKE_POLICY):
  The OLD behavior for policy CMP0018 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:34 (CMAKE_POLICY):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:41 (CMAKE_POLICY):
  The OLD behavior for policy CMP0045 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:42 (CMAKE_POLICY):
  The OLD behavior for policy CMP0042 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Running cmake version 3.15.0-rc1
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is MSVC 18.0.21005.1
-- The CXX compiler identification is MSVC 18.0.21005.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_GENERATOR: Visual Studio 12 2013
-- Looking for sys/types.h
CMake Warning (dev) at C:/CMake/share/cmake-3.15/Modules/CheckIncludeFile.cmake:80 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  CMAKE_REQUIRED_LIBRARIES is set to:

    ws2_32

  For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  C:/CMake/share/cmake-3.15/Modules/CheckTypeSize.cmake:230 (check_include_file)
  CMakeLists.txt:190 (CHECK_TYPE_SIZE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP 4
-- MySQL 5.7.25
-- Packaging as: mysql-5.7.25-win32
-- Local boost dir D:/Code_workspace/boost_1_59_0
-- Found D:/Code_workspace/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR D:/Code_workspace/boost_1_59_0
-- Found Threads: TRUE
-- Looking for include file crypt.h
-- Looking for include file crypt.h - not found
-- Looking for getnameinfo
-- Looking for getnameinfo - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - not found
-- Looking for log2
-- Looking for log2 - found
-- Looking for isinf
-- Looking for isinf - found
-- Performing Test HAVE_CXX_ISINF
-- Performing Test HAVE_CXX_ISINF - Success
-- Check size of struct timespec
-- Check size of struct timespec - failed
-- Performing Test HAVE_VISIBILITY_HIDDEN
-- Performing Test HAVE_VISIBILITY_HIDDEN - Success
-- Check size of struct sockaddr_in6
-- Check size of struct sockaddr_in6 - done
-- Check size of struct in6_addr
-- Check size of struct in6_addr - done
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING - Success
-- Looking for chown
-- Looking for chown - not found
-- Looking for include file numa.h
-- Looking for include file numa.h - not found
-- Looking for include file numaif.h
-- Looking for include file numaif.h - not found
-- NUMA library missing or required version not available
-- Check size of socklen_t
-- Check size of socklen_t - failed
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Performing Test HAVE_STRINGOP_OVERFLOW
-- Performing Test HAVE_STRINGOP_OVERFLOW - Failed
-- Performing Test HAVE_NO_UNUSED_CONST_VAR
-- Performing Test HAVE_NO_UNUSED_CONST_VAR - Failed
-- Cannot find system sasl libraries.
-- WITH_PROTOBUF=bundled
-- Performing Test HAVE_NO_SIGN_COMPARE
-- Performing Test HAVE_NO_SIGN_COMPARE - Failed
-- Performing Test HAVE_NO_UNUSED_TYPEDEFS
-- Performing Test HAVE_NO_UNUSED_TYPEDEFS - Failed
-- Performing Test HAVE_NO_IGNORED_QUALIFIERS
-- Performing Test HAVE_NO_IGNORED_QUALIFIERS - Failed
-- Performing Test HAVE_NO_RETURN_TYPE
-- Performing Test HAVE_NO_RETURN_TYPE - Failed
-- Performing Test HAVE_NO_UNUSED_FUNCTION
-- Performing Test HAVE_NO_UNUSED_FUNCTION - Failed
-- Performing Test HAVE_MAYBE_UNINITIALIZED
-- Performing Test HAVE_MAYBE_UNINITIALIZED - Failed
-- Performing Test HAVE_UNUSED_BUT_SET
-- Performing Test HAVE_UNUSED_BUT_SET - Failed
-- protobuf version is 2.6
-- Performing Test HAVE_SYS_THREAD_SELFID
-- Performing Test HAVE_SYS_THREAD_SELFID - Failed
-- Performing Test HAVE_SYS_GETTID
-- Performing Test HAVE_SYS_GETTID - Failed
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
-- Performing Test HAVE_INTEGER_PTHREAD_SELF
-- Performing Test HAVE_INTEGER_PTHREAD_SELF - Failed
-- Performing Test HAVE_STRINGOP_TRUNCATION
-- Performing Test HAVE_STRINGOP_TRUNCATION - Failed
-- Creating LDAP authentication SASL client library.
--  You need to set WITH_SASL path to build LDAP SASL client authentication plugin.
-- Library mysqlclient depends on OSLIBS ws2_32;Secur32
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlclient
-- MERGE_CONVENIENCE_LIBRARIES LIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt;auth_win_client
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt;auth_win_client
-- Looking for include file endian.h
-- Looking for include file endian.h - not found
-- Check size of long long
-- Check size of long long - done
-- Check size of long
-- Check size of long - done
-- Check size of int
-- Check size of int - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test HAVE_CAST_FUNCTION_TYPE
-- Performing Test HAVE_CAST_FUNCTION_TYPE - Failed
-- Using cmake version 3.15.0-rc1
-- Not building NDB
-- Performing Test HAVE_UNUSED_TYPEDEFS
-- Performing Test HAVE_UNUSED_TYPEDEFS - Failed
-- Performing Test HAVE_STRUCT_SOCKADDR_SA_LEN
-- Performing Test HAVE_STRUCT_SOCKADDR_SA_LEN - Failed
-- Performing Test HAVE_STRUCT_IFREQ_IFR_NAME
-- Performing Test HAVE_STRUCT_IFREQ_IFR_NAME - Failed
-- Performing Test HAVE_XDR_OPS_X_PUTINT32
-- Performing Test HAVE_XDR_OPS_X_PUTINT32 - Success
-- Performing Test HAVE_XDR_OPS_X_GETINT32
-- Performing Test HAVE_XDR_OPS_X_GETINT32 - Success
-- Performing Test HAVE___CONST
-- Performing Test HAVE___CONST - Success
-- Performing Test HAVE_RPC_INLINE_T
-- Performing Test HAVE_RPC_INLINE_T - Failed
-- Using Boost headers from D:/Code_workspace/boost_1_59_0
-- Performing Test CXX_HAVE_SIGN_COMPARE
-- Performing Test CXX_HAVE_SIGN_COMPARE - Failed
-- Performing Test CXX_HAVE_UNUSED_VARIABLE
-- Performing Test CXX_HAVE_UNUSED_VARIABLE - Failed
-- MYSQLX - Text log of protobuf messages enabled
-- Performing Test HAVE_UNUSED_PARAMETER
-- Performing Test HAVE_UNUSED_PARAMETER - Failed
-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80
-- Performing Test HAVE_MISLEADING_INDENTATION
-- Performing Test HAVE_MISLEADING_INDENTATION - Failed
-- Performing Test HAVE_NO_BUILTIN_MEMCMP
-- Performing Test HAVE_NO_BUILTIN_MEMCMP - Success
-- executable target mysqld debug_target D:/Code_workspace/mysql-5.7.25/BLD/sql/Debug/mysqld.exe
-- Library mysqlserver depends on OSLIBS ws2_32
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlserver
-- MERGE_CONVENIENCE_LIBRARIES LIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;yassl;taocrypt;archive_embedded;blackhole_embedded;csv_embedded;federated_embedded;heap_embedded;inn
obase;lz4_lib;myisam_embedded;myisammrg_embedded;partition_embedded;ngram_parser;sql_embedded
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;yassl;taocrypt;archive_embedded;blackhole_embedded;csv_embedded;federated_embedded;heap_embedded;i
nnobase;lz4_lib;myisam_embedded;myisammrg_embedded;partition_embedded;ngram_parser;sql_embedded
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files/WiX Toolset V3.8
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files/WiX Toolset V3.8/bin
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8/bin
-- WIX_DIR WIX_DIR-NOTFOUND looked at
-- Cannot find wix 3, installer project will not be generated
-- COMPILE_DEFINITIONS: _WIN32_WINNT=0x0601;WIN32_LEAN_AND_MEAN;NOGDI;NOMINMAX;BOOST_GEOMETRY_SQRT_CHECK_FINITENESS;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS: /DWIN32 /D_WINDOWS /W3 /MP /wd4800 /wd4805 /wd4996
-- CMAKE_CXX_FLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MP /wd4800 /wd4805 /wd4996 /we4099
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_C_FLAGS_DEBUG: /MDd /Z7 /Ob1 /Od /RTC1 /EHsc -DENABLED_DEBUG_SYNC -DSAFE_MUTEX
-- CMAKE_CXX_FLAGS_DEBUG: /MDd /Z7 /Ob1 /Od /RTC1 /EHsc -DENABLED_DEBUG_SYNC -DSAFE_MUTEX
-- CMAKE_C_FLAGS_RELWITHDEBINFO: /MD /Z7 /O2 /Ob1 /DNDEBUG /EHsc -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: /MD /Z7 /O2 /Ob1 /DNDEBUG /EHsc -DDBUG_OFF
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Code_workspace/mysql-5.7.25/BLD

D:\Code_workspace\mysql-5.7.25\BLD>

如果是编译64位,需要加参数 cmake .. –G “Visual Studio 12 2013 Win64”

5.打开sql\sql_locale.cc文件,用UTF-8的格式,再保存一遍,否则编译会出错。

6.运行下面的命令开始编译源码

D:\Code_workspace\mysql-5.7.25\BLD>cmake --build . --config relwithdebinfo --target package
........
     正在创建库 D:/Code_workspace/mysql-5.7.25/BLD/sql/RelWithDebInfo/udf_example.lib 和对象 D:/Code_workspace/mysql-5.7.25/BLD/sql/RelWithDebInfo/udf_example.exp
  udf_example.vcxproj -> D:\Code_workspace\mysql-5.7.25\BLD\sql\RelWithDebInfo\udf_example.dll
  Building Custom Rule D:/Code_workspace/mysql-5.7.25/plugin/password_validation/CMakeLists.txt
  validate_password.cc
     正在创建库 D:/Code_workspace/mysql-5.7.25/BLD/plugin/password_validation/RelWithDebInfo/validate_password.lib 和对象 D:/Code_workspace/mysql-5.7.25/BLD/plugin/password_validat
ion/Rel
  WithDebInfo/validate_password.exp
  validate_password.vcxproj -> D:\Code_workspace\mysql-5.7.25\BLD\plugin\password_validation\RelWithDebInfo\validate_password.dll
  Building Custom Rule D:/Code_workspace/mysql-5.7.25/plugin/version_token/CMakeLists.txt
  version_token.cc
     正在创建库 D:/Code_workspace/mysql-5.7.25/BLD/plugin/version_token/RelWithDebInfo/version_token.lib 和对象 D:/Code_workspace/mysql-5.7.25/BLD/plugin/version_token/RelWithDebIn
fo/vers
  ion_token.exp
  version_token.vcxproj -> D:\Code_workspace\mysql-5.7.25\BLD\plugin\version_token\RelWithDebInfo\version_token.dll
  Building Custom Rule D:/Code_workspace/mysql-5.7.25/extra/CMakeLists.txt
  zlib_decompress.cc
  zlib_decompress.vcxproj -> D:\Code_workspace\mysql-5.7.25\BLD\extra\RelWithDebInfo\zlib_decompress.exe
  Building Custom Rule D:/Code_workspace/mysql-5.7.25/CMakeLists.txt
  CPack: Create package using ZIP
  CPack: Install projects
  CPack: - Install project: MySQL
  CPack: Create package
  CPack: - package: D:/Code_workspace/mysql-5.7.25/BLD/mysql-5.7.25-win32.zip generated.

在文件夹中,有MySQL文件夹和winzip包产生:

D:\Code_workspace\mysql-5.7.25\BLD\_CPack_Packages\win32\ZIP>dir
 驱动器 D 中的卷是 软件
 卷的序列号是 5D84-49C8

 D:\Code_workspace\mysql-5.7.25\BLD\_CPack_Packages\win32\ZIP 的目录

2019-06-13  23:26              .
2019-06-13  23:26              ..
2019-06-13  23:25              mysql-5.7.25-win32
2019-06-13  23:26       426,298,188 mysql-5.7.25-win32.zip
               1 个文件    426,298,188 字节
               3 个目录  6,277,496,832 可用字节

下面使用自己编译的安装包来进行安装
1.将生成的安装包mysql-5.7.25-win32.zip解压D:\mysql-5.7.25-win32目录中,

2.在D:\mysql-5.7.25-win32目录中创建一个data目录用来存放数据文件

3.在mysql-5.7.25-win32根目录下创建my.ini文件添加以下内容

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4

[mysqld]
# 设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=D:\mysql-5.7.25-win32
# 设置 mysql数据库的数据的存放目录
datadir=D:\mysql-5.7.25-win32\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
explicit_defaults_for_timestamp=true
log-error=D:\mysql-5.7.25-win32\mysql.err
pid-file=D:\mysql-5.7.25-win32\mysqld.pid
socket =D:\mysql-5.7.25-win32\mysql.sock

4.文件目录切换至cmd所在路径(C:\Windows\System32\cmd.exe),右键以管理员身份运行cmd.exe,命令行进入mysql的bin目录,初始化数据库文件

C:\Users\Administrator>D:

D:\>cd D:\mysql-5.7.25-win32\bin

D:\mysql-5.7.25-win32\bin>mysqld --defaults-file=D:\mysql-5.7.25-win32\my.ini  -
-initialize

D:\mysql-5.7.25-win32\bin>

5.初始化成功后会在my.ini配置文件的datadir的目录下生成一些文件,其中mysql.err文件里说明了root账户的临时密码。例如:)CRHHke1mik=就是root账户的临时密码

2019-06-14T02:21:39.232301Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-06-14T02:21:39.335307Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-06-14T02:21:39.388310Z 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: 2447abd5-8e4b-11e9-81b2-00505683446c.
2019-06-14T02:21:39.395311Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-06-14T02:21:39.442313Z 1 [Note] A temporary password is generated for root@localhost: )CRHHke1mik=

6.注册MySQL服务

D:\mysql-5.7.25-win32\bin>mysqld -install MySQL
Service successfully installed.

7.启动MySQL服务

C:\Users\Administrator>net start MySQL
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

8.使用root账号登录MySQL数据库

D:\mysql-5.7.25-win32\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement befo
re executing this statement.
mysql>

9.修改root用户密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)

10.使用修改后的密码进行登录

D:\mysql-5.7.25-win32\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

到此使用vs2013编译的MySQL源码在Win7上安装完成了。

Linux 7 安装Mysql 5.7

在Oracle Linux 7.1中安装MySql 5.7 。mysql安装位置:/mysqlsoft/mysql,数据库文件数据位置:/mysqldata/mysql。
1.首先下载安装介质

mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

2. 在根目录下创建文件夹mysqlsoft和数据库数据文件/mysqldata/mysql

[root@cs2 /]# mkdir -p /mysqlsoft
[root@cs2 /]# mkdir -p /mysqldata/mysql
[root@cs2 /]# ls -lrt /mysqldata/
total 0
drwxr-xr-x 2 root root 6 May 31 11:58 mysql

3.上传介质mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz到/mysqlsoft目录中并解压

[root@cs2 /]# cd mysqlsoft
[root@cs2 mysqlsoft]# ls -lrt
total 628704
-rw-r--r-- 1 root root 643790848 Apr 20  2018 mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

[root@cs2 mysqlsoft]# tar -zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

[root@cs2 mysqlsoft]# ls -lrt
total 628704
-rw-r--r-- 1 root root 643790848 Apr 20  2018 mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x 9 root root       120 May 31 12:11 mysql-5.7.22-linux-glibc2.12-x86_64

建议一般不要修改默认文件名,通过软连接来完成

[root@cs2 mysqlsoft]# mv mysql-5.7.22-linux-glibc2.12-x86_64  mysql

[root@cs2 mysqlsoft]# ls -lrt
total 628704
-rw-r--r-- 1 root root 643790848 Apr 20  2018 mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x 9 root root       120 May 31 13:28 mysql-5.7.22-linux-glibc2.12-x86_64
lrwxrwxrwx 1 root root        35 May 31 13:33 mysql -> mysql-5.7.22-linux-glibc2.12-x86_64
[root@cs2 mysqlsoft]# cd mysql
[root@cs2 mysql]# ls
bin  COPYING  docs  include  lib  man  README  share  support-files

4. 创建mysql用户与用户组

[root@cs2 mysql]# groupadd mysql
[root@cs2 mysql]# useradd -r -g mysql -s /bin/false mysql

因为用户只用于所有权目的,而不是登录目的,useradd命令使用-r与-s /bin/false选项来创建一个用户没有登录服务器主机的权限。

5.修改/mysqlsoft/mysql与/mysqldata/mysql目录权限

[root@cs2 /]# chown -R mysql:mysql /mysqlsoft/mysql
[root@cs2 /]# chown -R mysql:mysql /mysqldata/mysql
[root@cs2 /]# chmod -R 775 /mysqlsoft/mysql
[root@cs2 /]# chmod -R 775 /mysqldata/mysql

6. MySQL对于libaio库有依赖性。台果这个libaio库没有安装那么数据目录初始化与后续的数据库服务启动将会失败,安装libaio库执行以下操作:
查询是否安装了libaio库

[root@cs2 local]# yum search libaio
Loaded plugins: langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
=========================================================================================================== N/S matched: libaio ============================================================================================================
libaio.i686 : Linux-native asynchronous I/O access library
libaio.x86_64 : Linux-native asynchronous I/O access library
libaio-devel.i686 : Development files for Linux-native asynchronous I/O access
libaio-devel.x86_64 : Development files for Linux-native asynchronous I/O access

  Name and summary matches only, use "search all" for everything.

如果没有安装,可以执行下面的命令来安装

[root@cs2 local]# yum install libaio
Loaded plugins: langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
file:///run/media/jy/OL-7.1%20Server.x86_64/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /run/media/jy/OL-7.1%20Server.x86_64/repodata/repomd.xml"
Trying other mirror.
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Nothing to do

7.配置mysql参数
只是设置几个简单的mysql运行参数

[root@cs2 ~]# vi /mysqlsoft/mysql/my.cnf 
[mysqld]
basedir=/mysqlsoft/mysql
datadir=/mysqldata/mysql
bind-address=0.0.0.0
user=mysql
port=3306
log-error=/mysqldata/mysql/mysql.err
pid-file=/mysqldata/mysql/mysqld.pid
socket = /mysqldata/mysql/mysql.sock
character-set-server=utf8
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true
"/mysqlsoft/mysql/my.cnf" [New] 67L, 1642C written

注意:log-error 一定要配置,因为如果mysql启动错误,可以从日志文件中找到错误原因。其次bind—address配置0.0.0.0是为了监听所有的连接。还有就是socket参数所指定的mysql.sock文件的路径最好设置为/tmp/mysql.sock,因为unix socket文件的缺省位置在/tmp目录中。

8.初始化mysql

[root@cs2 /]# cd /mysqlsoft/mysql/bin
[root@cs2 bin]# ./mysqld --user=mysql  --defaults-file=/mysqlsoft/mysql/my.cnf --basedir=/mysqlsoft/mysql --datadir=/mysqldata/mysql --initialize


[root@cs2 mysql]# cat mysql.err
2019-05-31T06:01:50.260643Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-05-31T06:01:50.260731Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
 100
 100
2019-05-31T06:01:53.795162Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-05-31T06:01:54.049268Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-05-31T06:01:54.102171Z 0 [ERROR] unknown variable 'defaults-file=/mysqlsoft/mysql/my.cnf'
2019-05-31T06:01:54.102193Z 0 [ERROR] Aborting

网上有人说是文件权限的问题,然后重新授权chmod 664 my.cnf 但并没有解决,有人建议调整一下参数顺序就好!!!最后调整了一下参数顺序果然有效:

[root@cs2 bin]# ./mysqld  --defaults-file=/mysqlsoft/mysql/my.cnf --initialize --basedir=/mysqlsoft/mysql --datadir=/mysqldata/mysql --user=mysql

[root@cs2 mysql]# cat mysql.err
2019-05-31T06:05:06.362925Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-05-31T06:05:06.362994Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
 100
 100
2019-05-31T06:05:09.779913Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-05-31T06:05:10.026707Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-05-31T06:05:10.094462Z 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: 0be6983a-836a-11e9-a341-005056a092af.
2019-05-31T06:05:10.109209Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-05-31T06:05:10.110107Z 1 [Note] A temporary password is generated for root@localhost: ,;pm93qnL%-j
2019-05-31T06:05:14.966324Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966373Z 1 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966391Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966419Z 1 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966428Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966441Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966493Z 1 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2019-05-31T06:05:14.966508Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.

其中[Note] A temporary password is generated for root@localhost: ,;pm93qnL%-j的root@localhost: 后面跟的是mysql数据库登录的临时密码,各人安装生成的临时密码不一样。可以看到到日志文件没有报错,而且有了临时密码,表示初始化成功。

9. 如果想服务能够部署自动支持安全连接,使用mysql_ssl_rsa_setup工具来创建缺省SSL与RSA文件

[root@cs2 bin]# ./mysql_ssl_rsa_setup --datadir=/mysqldata/mysql
Generating a 2048 bit RSA private key
......................................................................+++
..............................................................+++
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
.............+++
..............+++
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
.....................................+++
................................................+++
writing new private key to 'client-key.pem'
-----

9.启动mysql服务

[root@cs2 /]# sh /mysqlsoft/mysql/support-files/mysql.server start
/mysqlsoft/mysql/support-files/mysql.server: line 239: my_print_defaults: command not found
/mysqlsoft/mysql/support-files/mysql.server: line 259: cd: /usr/local/mysql: No such file or directory
Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)

启动mysql服务命令会报错,因为没有修改mysql的配置文件
修改Mysql配置文件,修改前为以下内容

if test -z "$basedir"
then
  basedir=/usr/local/mysql
  bindir=/usr/local/mysql/bin
  if test -z "$datadir"
  then
    datadir=/usr/local/mysql/data
  fi
  sbindir=/usr/local/mysql/bin
  libexecdir=/usr/local/mysql/bin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  libexecdir="$basedir/libexec"
fi

修改后的内容如下

[root@cs2 ~]# vi /mysqlsoft/mysql/support-files/mysql.server
if test -z "$basedir"
then
  basedir=/mysqlsoft/mysql
  bindir=/mysqlsoft/mysql/bin
  if test -z "$datadir"
  then
    datadir=/mysqldata/mysql
  fi
  sbindir=/mysqlsoft/mysql/bin
  libexecdir=/mysqlsoft/mysql/bin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  libexecdir="$basedir/libexec"
fi


[root@cs2 ~]# cp /mysqlsoft/mysql/support-files/mysql.server  /etc/init.d/mysqld

[root@cs2 ~]# chmod 755 /etc/init.d/mysqld

10.启动mysql

[root@cs2 ~]# service mysqld start
Starting MySQL.. SUCCESS!

11.配置环境变量

[root@cs2 ~]# vi /etc/profile
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

export MYSQL_HOME=/mysqlsoft/mysql/
export PATH=$PATH:$MYSQL_HOME/bin

11.登录Mysql
初始化成功后,查看初始化密码

[root@cs2 ~]# cat /mysqldata/mysql/mysql.err | grep password
2019-05-31T06:05:10.110107Z 1 [Note] A temporary password is generated for root@localhost: ,;pm93qnL%-j

并输入刚刚复制的密码,但是 却提示不能通过mysql.sock文件实现连接

[root@cs2 bin]# ./mysqladmin -u root -p password
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/mysqlsoft/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/mysqlsoft/mysql/mysql.sock' exists!

这里就奇怪了,因为在my.cnf文件中设置的socket文件路径为/mysqldata/mysql/mysql.sock,但mysql所使用的文件不是启动服务所生成的。

[root@cs2 ~]# cat /mysqlsoft/mysql/my.cnf
[mysqld]
basedir=/mysqlsoft/mysql
datadir=/mysqldata/mysql
bind-address=0.0.0.0
user=mysql
port=3306
log-error=/mysqldata/mysql/mysql.err
pid-file=/mysqldata/mysql/mysqld.pid
socket = /mysqldata/mysql/mysql.sock
character-set-server=utf8
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true

[root@cs2 mysql]# ls -lrt
total 286896
-rw-r----- 1 mysql mysql 134217728 May 31 14:05 ib_logfile1
-rw-r----- 1 mysql mysql        56 May 31 14:05 auto.cnf
drwxr-x--- 2 mysql mysql      8192 May 31 14:05 performance_schema
drwxr-x--- 2 mysql mysql      4096 May 31 14:05 mysql
drwxr-x--- 2 mysql mysql      8192 May 31 14:05 sys
-rw------- 1 mysql mysql      1679 May 31 14:25 ca-key.pem
-rw-r--r-- 1 mysql mysql      1107 May 31 14:25 ca.pem
-rw------- 1 mysql mysql      1679 May 31 14:25 server-key.pem
-rw-r--r-- 1 mysql mysql      1107 May 31 14:25 server-cert.pem
-rw------- 1 mysql mysql      1679 May 31 14:25 client-key.pem
-rw-r--r-- 1 mysql mysql      1107 May 31 14:25 client-cert.pem
-rw------- 1 mysql mysql      1679 May 31 14:25 private_key.pem
-rw-r--r-- 1 mysql mysql       451 May 31 14:25 public_key.pem
-rw-r----- 1 mysql mysql       291 May 31 18:05 ib_buffer_pool
-rw------- 1 mysql mysql         6 May 31 18:08 mysql.sock.lock
srwxrwxrwx 1 mysql mysql         0 May 31 18:08 mysql.sock
-rw-r----- 1 mysql mysql         6 May 31 18:08 mysqld.pid
-rw-r----- 1 mysql mysql    101396 May 31 18:08 mysql.err
-rw-r----- 1 mysql mysql  12582912 May 31 18:08 ibtmp1
-rw-r----- 1 mysql mysql  12582912 May 31 18:08 ibdata1
-rw-r----- 1 mysql mysql 134217728 May 31 18:08 ib_logfile0

可以看到在/var/lib/mysql目录中的mysql.sock是指向/mysqlsoft/mysql/mysql.sock文件的。

[mysql@cs2 ~]$ ls -lrt /var/lib/mysql 
总用量 110604
-rw-rw----. 1   27   27 50331648 10月 11 2017 ib_logfile1
drwx------. 2   27   27     4096 10月 11 2017 performance_schema
drwx------. 2   27   27     4096 10月 11 2017 mysql
-rw-rw----. 1   27   27       56 10月 11 2017 auto.cnf
-rw-rw----. 1   27   27 50331648 5月  30 18:32 ib_logfile0
-rw-rw----. 1   27   27 12582912 5月  30 18:32 ibdata1
lrwxrwxrwx  1 root root       27 5月  31 15:44 mysql.sock -> /mysqlsoft/mysql/mysql.sock

如果使用-S选项来指定生成的mysql.sock文件进行登录是可以成功登录的

[mysql@cs2 mysql]$  mysql -S /mysqldata/mysql/mysql.sock -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit

修改socket文件路径为/mysqlsoft/mysql/mysql.sock

[root@cs2 ~]# cat /mysqlsoft/mysql/my.cnf
[mysqld]
basedir=/mysqlsoft/mysql
datadir=/mysqldata/mysql
bind-address=0.0.0.0
user=mysql
port=3306
log-error=/mysqldata/mysql/mysql.err
pid-file=/mysqldata/mysql/mysqld.pid
socket = /mysqlsoft/mysql/mysql.sock
character-set-server=utf8
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true

再重启mysql服务

[root@cs2 ~]# service mysqld stop
Shutting down MySQL.. SUCCESS! 
[root@cs2 ~]# service mysqld start
Starting MySQL.. SUCCESS!

[mysql@cs2 ~]$ mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

这就可以登录了。

12.重置root用户密码

[mysql@cs2 ~]$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set password=password("123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)

13.设置允许远程登录mysql
如果要远程访问数据库,只需要把拥有全部权限的root账号对应的记录的Host字段改为%就可以了

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to root@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

测试远程登录

-bash-4.2$ mysql -h 10.11.13.19 -P 3306 -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT DISTINCT CONCAT('User: [', user, '''@''', host, '];') AS USER_HOST FROM user; 
+------------------------------------+
| USER_HOST                          |
+------------------------------------+
| User: [root'@'%];                  |
| User: [mysql.session'@'localhost]; |
| User: [mysql.sys'@'localhost];     |
+------------------------------------+
3 rows in set (0.05 sec)

到此所有的安装步骤就完成,安装还是相当简单的。