Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the RPM Package from the Mirror Site

The following describes how to install MySQL using the RPM package of the mirror site. This section describes how to install MySQL 8.0.17 on CentOS 7.6. You can refer to this section when installing MySQL of other versions.

To install MySQL using the RPM package from the mirror site, perform the following steps:

  1. Configure the yum source.
    1. Back up the original yum repository files and create a directory for the repo file.
      mv /etc/yum.repos.d/ /etc/yum.repos.d-bak
      #mkdir /etc/yum.repos.d
    2. Write the new configuration to the repo file.
      echo -e "[kunpeng]\nname=CentOS-kunpeng - Base - mirrors.huaweicloud.com\nbaseurl=https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/CentOS-Base-kunpeng.repo
    3. Check whether the new configuration is successfully written to repo in step 1.b.
      cat /etc/yum.repos.d/CentOS-Base-kunpeng.repo

      If the command output is the same as the written content in 1.b, the operation is successful. Expected result:

      [kunpeng]
      name=CentOS-kunpeng - Base - mirrors.huaweicloud.com
      baseurl=https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/
      gpgcheck=0
      enabled=1
  2. To use the RPM packages from the mirror site , perform the following steps to avoid database initialization failure.
    1. Go to the /home directory on the server and download rpm-bug.zip.
      1
      2
      cd /home
      wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/database/patch/rpm-bug.zip
      
    2. Decompress the package.
      1
      unzip rpm-bug.zip
      
    3. Go to the directory where the package is decompressed and save the files in the directory to the corresponding library file directory. When a message is displayed asking whether to rewrite the file, enter y and press Enter.
      1
      2
      3
      4
      5
      6
      cd rpm-bug
      cp libatomic.so.1 /usr/lib64/
      cp libstdc++.so.6.0.24 /lib64/
      rm /lib64/libstdc++.so.6
      ln -s /lib64/libstdc++.so.6.0.24 /lib64/libstdc++.so.6
      cp libaio.so.1.0.1 /usr/lib64/libaio.so.1
      
  3. Clear the cache.
    1
    yum clean all
    
  4. Cache the software package information in the Yum repository to the local drive.
    1
    yum makecache
    
  5. Install the RPM package.
    1
    yum -y install mysql-8.0.17-1.el7.aarch64 --enablerepo=kunpeng
    

  6. Check the installed RPM package.
    1
    rpm -qa | grep mysql
    

    Expected result:

    mysql-8.0.17-1.el7.aarch64