Upgrading to MySQL 5.0.27 on RHEL and CentOS
One of the most common technical recommendations given on the vbulletin.com forums is to upgrade your software versions to the newest available. I've already covered how to upgrade Apache's httpd and PHP so now I'm going to explain how to upgrade your RHEL/CentOS 4 system to use MySQL 5.0.27. This is not a terribly difficult process but it is VERY time consuming. Expect to spend about 10 minutes prepping and about an hour compiling (even on a high-end box).
To start, you'll need three things. First, you're going to need 'root' access to your server. If you don't have it, even if you can build the RPMs, you won't be able to install them. Second, on most machines, you'll need to install a huge list of dependencies. Finally, you'll need the MySQL src.rpm from FC7's development tree.
To start out, if you've never built a src.rpm file before, log in to your server as 'root' and run the following commands:
- mkdir /usr/src/redhat
- chmod -R 777 /usr/src/redhat
After that, you can fill the dependencies using one of the commands below. If you installed a "minimal" system then there may be about 30 packages that get pulled in (if you have the 'yum' command, use that, if not, use 'up2date').
- yum install wget diffutils gcc cpp gcc-c++ make autoconf automake rpm-build libtool gperf perl time zlib-devel ncurses-devel openssl-devel readline-devel perl-DBI perl-DBD-MySQL
- up2date -u wget diffutils gcc cpp gcc-c++ make autoconf automake rpm-build libtool gperf perl time zlib-devel ncurses-devel openssl-devel readline-devel perl-DBI perl-DBD-MySQL
Next, switch to a non-root user, download the MySQL 5.0.27 src.rpm and run the following commands:
- rpm -ivh mysql-5.0.27-1.fc7.src.rpm
- cd /usr/src/redhat/
Update (1/5/2007): As of 1/1/2007, this src.rpm will no longer compile as-is. You have three choices when it comes to building the package. First, you can disable regression testing by editing the mysql.spec file (which I really wouldn't recommend). Second, you can set the date of your computer to be sometime in 2006 (which would be the easiest solution). Third, you can apply a patch from MySQL bug #25359 using the instructions below.
To apply the patch you will first need to download this patch to your SOURCES folder. After that, edit the mysql.spec file in the SPECS folder. After line 28, add "Patch11: mysql-test-view-2007.patch". After line 121, add "%patch11 -p1". You can now save the file and return to the shell.
From this point on everything is pretty straightforward and you are now ready to build the RPMs. Before we start though, one word of caution. If you are one of those people that builds RPMs as 'root' even when you're told that it's a bad idea, you're going to waste a LOT of time here. This src.rpm will NOT build unless you are a non-root user. As 'root' it will fail during testing after about 45 minutes.
Now that that's out of the way, run the following command and then go watch something on TV.
- rpmbuild -bb SPECS/mysql.spec
Once that's finished, assuming that there were no errors, you will end up with 5 RPMs in the '/usr/src/redhat/RPMS/i386' folder that you can install as you like. If you're planning on running a MySQL server then you'll need the 'mysql-server' package. If you're planning on connecting to a remote server then you'll only need the 'mysql' package as that contains the client libraries. If you're going to follow one of my PHP guides (Installing PHP 5.1.6, Installing PHP 5.2.0) then you can also install the 'mysql-devel' package and skip the associated section of those how-to's.
That said, you're done! Any questions or comments, let me know.
Digg this story