1. Obtaining the yum repo tarball
1. Log on to support.oracle.com using your Oracle SSO ID.
2. Click on the “Patches & Updates” tab.
3. Click the “Product or Family (Advanced)” button to search by product.
4. Type “MySQL Server” for the Product.
5. Select the desired version in the “Release” pulldown.
6. Select “Linux x86-64” in the “Platform” pulldown.
7. Select “Description” in the first “and” pulldown under “Platform”.
8. Select “contains” in the search type pulldown.
9. Type “yum repository” in the free text field for the description.
10. Click the “Search” button.
From the results screen, choose the appropriate yum repository tarball for your distro. For example, if you are running Oracle Linux 6, CentOS 6, or RHEL 6, you would choose the appropriate release of MySQL Database and the “Yum Repository TAR for Oracle Linux / RHEL 6 x86 (64 bit) (Patchset)” link.
Save this file on the server that will act as your yum repository, unzip, and extract the gzipped tarball to webspace that is accessible from your MySQL servers.
2. Setting up and using the yum repository
MySQL yum repository tar file
This tar file contains the RPM files necessary to install MySQL Server, together with Yum repository metadata for the setup of a self-hosted Yum repository. This provides a way for administrators to support easy installation and upgrades of MySQL infrastructure using the Yum package manager.
Basic setup steps
These are the basic steps to set up a self-hosted Yum repository using this tar file:
1. Create a repository setup file called mysql.repo (see below)
2. Copy the mysql.repo file to the directory /etc/yum.repos.d/ on each database server.
3. On the server that will host the Yum repository, make the directory structure in this tar file available over the network to the database servers, typically by setting up an http or nfs server on the Yum server host.
3. Creating the mysql.repo file
The mysql.repo file tells the yum client on each database server where the MySQL Yum repo is located. The file contains a repository name along with the network location of the packages and the security key needed to be used to verify the identity of the Yum server.
The network paths listed in the mysql.repo file must match the chosen network protocol, (see step a) above), and point to the server name/directory path where the RPM packages are hosted.
For example, using a web server with hostname example.com and with the tarball unpacked in a directory exposed as /repo/ from the webserver, the contents of the mysql.repo file on each database host should be as follows. Example based on 5.6, adjust as appropriate for the desired release:
[mysql-5.6] name=mysql-5.6 baseurl=http://example.com/repo/mysql-5.6/ gpgkey=http://example.com/repo/RPM-GPG-KEY-mysql gpgcheck=1 enabled=0 [mysql-5.6.21] name=mysql-5.6.21 baseurl=http://example.com/repo/mysql-5.6/5.6.21/ gpgkey=http://example.com/repo/RPM-GPG-KEY-mysql gpgcheck=1 enabled=1
The above example defines two Yum repositories. The first section(mysql-5.6) defines a repository that tracks the MySQL 5.6 release series, so that when you make a new MySQL 5.6 release available on the Yum server, each database server that has the enabled option for this section set to 1 gets upgraded to that new MySQL release when a “yum update” is performed,
The second section, when enabled, will cause the database server to only install MySQL 5.6.21 packages. This allows fine-grained control of which MySQL version gets installed from the repo on each database server.