Oracle MySQL in Fedora Rawhide (F22)

Due to some constraint, I need to install Oracle MySQL community version in Fedora Rawhide (F22) instead of using the default MariaDB. Installation procedure through Yum repository as follows:

Download and install the Yum repository rpm. We will download the latest version available which is for F21. No worry, we will fix the release version not found issue later. Note only rpm command support installation directly through an URL instead of yum command.
$ sudo rpm -ivh http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-release-fc21-6   ################################# [100%]

To check that the MySQL Community repositories have been installed properly.
$ yum repolist | grep mysql
mysql-connectors-community/22/x86_64 MySQL Connectors Community             3
mysql-tools-community/22/x86_64      MySQL Tools Community                  1
mysql56-community/22/x86_64          MySQL 5.6 Community Server            32

Next, update our locate RPM database with newly installed MySQL repository package. Unfortunately, as I mentioned earlier, the repository does not contains packages for F22 release.
$ sudo yum update
Loaded plugins: aliases, fastestmirror, remove-with-leaves, yum-fast-downloader
http://repo.mysql.com/yum/mysql-connectors-community/fc/22/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://repo.mysql.com/yum/mysql-tools-community/fc/22/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://repo.mysql.com/yum/mysql-5.6-community/fc/22/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
Loading mirror speeds from cached hostfile
 * rpmfusion-free-rawhide: mirrors.tummy.com
 * rpmfusion-nonfree-rawhide: mirror.bjtu.edu.cn
No packages marked for update

If we look into the MySQL Community repository file, we can see that we need to change the $releasever variable.
$ cat /etc/yum.repos.d/mysql-community.repo | grep baseurl
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/fc/$releasever/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-tools-community/fc/$releasever/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/fc/$releasever/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/fc/$releasever/$basearch/

Now, we're going to check the values of these yum variables as seen above using yum-debug-dump command.
$ sudo yum-debug-dump
Loaded plugins: fastestmirror, remove-with-leaves, yum-fast-downloader
Loading mirror speeds from cached hostfile
 * rpmfusion-free-rawhide: mirrors.tummy.com
 * rpmfusion-nonfree-rawhide: mirror.bjtu.edu.cn
Output written to: /tmp/yum_debug_dump-butterfly-2015-02-15_03:47:14.txt.gz

$ zcat /tmp/yum_debug_dump-W08LAP040-2015-02-15_03\:47\:14.txt.gz  | grep "YUM INFO" -A 3
%%%%YUM INFO
  arch: ia32e
  basearch: x86_64
  releasever: 22

Replace the $releasever manually with Fedora version F21 as it should let us install it without issues.
$ sudo sed -i 's/$releasever/21/g' mysql-community*
$ sudo cat mysql-community* | grep baseurl
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/fc/21/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-tools-community/fc/21/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/fc/21/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/fc/21/$basearch/
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/fc/21/SRPMS
baseurl=http://repo.mysql.com/yum/mysql-tools-community/fc/21/SRPMS
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/fc/21/SRPMS
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/fc/21/SRPMS

Re-update all Yum repositories again.
$ sudo yum update
Loaded plugins: aliases, fastestmirror, remove-with-leaves, yum-fast-downloader
mysql-connectors-community                            | 2.5 kB  00:00:00     
mysql-tools-community                                 | 2.4 kB  00:00:00     
mysql56-community                                     | 2.5 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * rpmfusion-free-rawhide: mirrors.tummy.com
 * rpmfusion-nonfree-rawhide: mirror.bjtu.edu.cn
No packages marked for update

Lastly, installation of both the MySQL Community client and server.
$ sudo yum install mysql-server mysql

No comments:

Post a Comment