2.5.2 Replacing a Third-Party Distribution of MySQL Using the MySQL Yum Repository

For supported Yum-based platforms (see Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”, for a list), you can replace a third-party distribution of MySQL with the latest GA release from MySQL using the MySQL Yum repository. According to how your third-party distribution of MySQL was installed, there are different steps to follow:

Replacing a Native Third-Party Distribution of MySQL

If you have installed a third-party distribution of MySQL from a native software repository (that is, a software repository provided by your own Linux distribution), follow these steps:

  1. Backing Up Your Database

    To avoid loss of data, always back up your database before trying to replace your MySQL installation using the MySQL Yum repository. See Chapter 7, Backup and Recovery, on how to back up your database.

  2. Adding the MySQL Yum Repository

    Add the MySQL Yum repository to your system's repository list by following the instructions given in Adding the MySQL Yum Repository.

  3. Replacing the Native Third-Party Distribution by a Yum Update of a DNF Upgrade

    By design, the MySQL Yum repository will replace your native, third-party MySQL when you perform a yum update command (or dnf upgrade for Fedora 22) on the system, or a yum update mysql-server (or dnf upgrade mysql-server for Fedora 22).

After updating MySQL using the Yum repository, applications compiled with older versions of the shared client libraries should continue to work. However, if you want to recompile applications and dynamically link them with the updated libraries, see Upgrading to the Shared Client Libraries, for some special considerations.

Replacing a Nonnative Third-Party Distribution of MySQL

If you have installed a third-party distribution of MySQL from a nonnative software repository (that is, a software repository not provided by your own Linux distribution), follow these steps:

  1. Backing Up Your Database

    To avoid loss of data, always back up your database before trying to replace your MySQL installation using the MySQL Yum repository. See Chapter 7, Backup and Recovery, on how to back up your database.

  2. Stopping Yum from Receiving MySQL Packages from Third-Party, Nonnative Repositories

    Before you can use the MySQL Yum repository for installing MySQL, you must stop your system from receiving MySQL packages from any third-party, nonnative Yum repositories.

    For example, if you have installed MariaDB using their own software repository, get a list of the installed MariaDB packages using the following command (for Fedora 22, replace yum in the command with dnf):

    shell> yum list installed mariadb\*

    This is a sample output for the command:

    MariaDB-common.i686                      10.0.4-1                       @mariadb
    MariaDB-compat.i686                      10.0.4-1                       @mariadb
    MariaDB-server.i686                      10.0.4-1                       @mariadb
    

    From the command output, we can identify the installed packages (MariaDB-common, MariaDB-compat, and MariaDB-server) and the source of them (a nonnative software repository named mariadb).

    As another example, if you have installed Percona using their own software repository, get a list of the installed Percona packages using the following command (for Fedora 22, replace yum in the command with dnf):

    shell> yum list installed Percona\*

    This is a sample output for the command:

    Percona-Server-client-55.i686     5.5.39-rel36.0.el6          @percona-release-i386         
    Percona-Server-server-55.i686     5.5.39-rel36.0.el6          @percona-release-i386         
    Percona-Server-shared-55.i686     5.5.39-rel36.0.el6          @percona-release-i386  
    percona-release.noarch            0.1-3                       @/percona-release-0.1-3.noarch
    

    From the command output, we can identify the installed packages (Percona-Server-client, Percona-Server-server, Percona-Server-shared, and percona-release.noarch) and the source of them (a nonnative software repository named percona-release).

    If you are not sure which third-party MySQL fork you have installed, this command should reveal it and list the RPM packages installed for it, as well as the third-party repository that supplies the packages (for Fedora 22, replace yum in the command with dnf):

    shell> yum --disablerepo=\* provides mysql\*

    The next step is to stop Yum from receiving packages from the nonnative repository. If the yum-config-manager utility is supported on your platform, you can, for example, use this command for MariaDB:

    shell> sudo yum-config-manager --disable mariadb

    And use this command for Percona:

    shell> sudo yum-config-manager --disable percona-release

    You can perform the same task by removing the entry for the software repository existing in one of the repository files under the /etc/yum.repos.d/ directory. This is how the entry typically looks like for MariaDB:

    [mariadb] name = MariaDB
     baseurl = [base URL for repository]
     gpgkey = [URL for GPG key]
     gpgcheck =1 

    The entry is usually found in the file /etc/yum.repos.d/MariaDB.repo for MariaDB—delete the file, or remove entry from it (or from the file in which you find the entry).

    Note

    This step is not necessary for an installation that was configured with a Yum repository release package (like Percona) if you are going to remove the release package (percona-release.noarch for Percona), as shown in the uninstall command for Percona in Step 3 below.

  3. Uninstalling the Nonnative Third-Party MySQL Distribution of MySQL

    The nonnative third-party MySQL distribution must first be uninstalled before you can use the MySQL Yum repository to install MySQL. For the MariaDB packages found in Step 2 above, uninstall them with the following command (for Fedora 22, replace yum in the command with dnf):

    shell> sudo yum remove MariaDB-common MariaDB-compat MariaDB-server

    For the Percona packages we found in Step 2 above (for a similar command on Fedora 22, replace yum in the command with dnf):

    shell> sudo yum remove Percona-Server-client-55 Percona-Server-server-55 \
      Percona-Server-shared-55.i686 percona-release

  4. Installing MySQL with the MySQL Yum Repository

    Then, install MySQL with the MySQL Yum repository by following the instructions given in Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”: .

    Important