Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the RPM Package from the Official Website

The following describes how to install MySQL using the RPM package on the official website. 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.

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

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

      [local]
      name=local
      baseurl=file:///mnt
      gpgcheck=0
      enabled=1
  2. Mount the OS image.

    Mount the OS image using either of the following methods:

    • Method 1: Use the KVM to mount the image to the /mnt/ directory.
      1
      mount /dev/sr0 /mnt/
      
    • Method 2: Upload the OS image to the /home directory and mount the image to the /mnt/ directory.
      1
      mount /home/CentOS-7-aarch64-Everything-1810.iso /mnt/
      

      Change the ISO file name based on your OS type.

  3. Download the RPM package from the official website.
    1. Download the MySQL RPM package.

      Download URL: https://downloads.mysql.com/archives/community/

    2. Create a mysql-rpm folder in the /home partition on the server, and upload the RPM package to the folder.
      1
      mkdir /home/mysql-rpm
      
    3. Go to the directory of the RPM package and decompress the RPM package.
      1
      2
      cd /home/mysql-rpm
      tar xvf mysql-8.0.17-1.el7.aarch64.rpm-bundle.tar
      

      If the following information is displayed, the RPM installation package is decompressed successfully:

      mysql-community-libs-compat-8.0.17-1.el7.aarch64.rpm
      mysql-community-devel-8.0.17-1.el7.aarch64.rpm
      mysql-community-server-8.0.17-1.el7.aarch64.rpm
      mysql-community-common-8.0.17-1.el7.aarch64.rpm
      mysql-community-libs-8.0.17-1.el7.aarch64.rpm
      mysql-community-test-8.0.17-1.el7.aarch64.rpm
      mysql-community-embedded-compat-8.0.17-1.el7.aarch64.rpm
      mysql-community-client-8.0.17-1.el7.aarch64.rpm
      You have new mail in /var/spool/mail/root
  4. Uninstall mariadb-libs of the OS. Otherwise, mysql-community-libs cannot be installed.
    1
    yum -y remove mariadb-libs
    
  5. Install dependencies.
    1
    yum -y install net-tools
    
  6. Go to the mysql-rpm directory and install the MySQL RPM packages.
    1
    2
    3
    4
    5
    cd /home/mysql-rpm
    rpm -ivh mysql-community-common-8.0.17-1.el7.aarch64.rpm
    rpm -ivh mysql-community-libs-8.0.17-1.el7.aarch64.rpm
    rpm -ivh mysql-community-client-8.0.17-1.el7.aarch64.rpm
    rpm -ivh mysql-community-server-8.0.17-1.el7.aarch64.rpm
    

    Expected result:

    [root@localhost mysql-rpm]# rpm -ivh mysql-community-common-8.0.17-1.el7.aarch64.rpm
    warning: mysql-community-common-8.0.17-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:mysql-community-common-8.0.17-1.e################################# [100%]
    [root@localhost mysql-rpm]# rpm -ivh mysql-community-libs-8.0.17-1.el7.aarch64.rpm
    warning: mysql-community-libs-8.0.17-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:mysql-community-libs-8.0.17-1.el7################################# [100%]
    [root@localhost mysql-rpm]# rpm -ivh mysql-community-client-8.0.17-1.el7.aarch64.rpm
    warning: mysql-community-client-8.0.17-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:mysql-community-client-8.0.17-1.e################################# [100%]
    [root@localhost mysql-rpm]# rpm -ivh mysql-community-server-8.0.17-1.el7.aarch64.rpm
    warning: mysql-community-server-8.0.17-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:mysql-community-server-8.0.17-1.e################################# [100%]