Home > CentOS, MySQL > MySQL 5.1.34 Upgrades on CentOS 4 – ho hum

MySQL 5.1.34 Upgrades on CentOS 4 – ho hum

So, I needed to upgrade MySQL on our development boxes today and I was met by a little surprise from the RPM program…

Basically it won’t do an upgrade as the vendor has changed from being MySQL AB to Sun Microsystems, and as a result I have to do a complete uninstall and re-install manually…

Ho hum, I know it’s a small issue and for the best, but it’s still a pain in the ass when something silly such as  vendor name change wastes time in what would otherwise be a quick and simple upgrade.

So anyway as I’m going through it the following might be useful to you if you have to do the same any time soon.

First download all the current MySQL packages you need:

$hell> mkdir mysql-5.1.34

$hell> cd mysql-5.1.34

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-client-community-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-shared-community-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-shared-compat-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-devel-community-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-test-community-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

$hell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-community-debuginfo-5.1.34-0.rhel4.i386.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/

Then  stop all running MySQL Process:

$hell> /etc/init.d/myst stop

Then find all the MySQL packages you need to remove by running:

$hell> rpm -qa | grep -i '^mysql-'

Then uninstall each e.g.:

$hell> rpm -e MySQL-client-community-5.1.29-0.rhel4

Then re-install all the new ones you just downloaded e.g.:

$hell> rpm -i MySQL-shared-community-5.1.34-0.rhel4.i386.rpm

Then run the MySQL upgrade program to do the final checks and upgrade the MySQL system database if necessary:

$hell> /usr/bin/mysql_upgrade -uroot -p

And that’s it, all should work nicely again :)

Remember though, you shouldn’t upgrade between major versions that aren’t in sequence. i.e. Don’t upgrade from MySQL from 4.0 to 5.1 as the additions to the software made in 4.1, 5.0, etc. can be lost by skipping these intermediate upgrades.

Related posts on coderchris.com:

  1. Installing Flash Media Server 2 On Linux (CentOS 4.4)
    Recently I was asked by a client to look at purchasing and installing FMS2 on...
  2. Setting Up Ubuntu PHP 5.2, MySQL 5.1 and Apache 2 on a PS3
    Recently I wanted a new development box/streaming media server for use around the house and...
  3. Adding Additional Software Repositories To Yum
    I’ve added this (slightly edited) post here as I’ve found it useful in the past,...
  4. ATI Radion 9600 TV Output On Centos 5.0 (And Probably CentOS 4.4)
    In a previous post about how to install Flash Media Server 2 on CentOS 4.4...
  5. PHP IMAP Error On CentOS Linux 4.2
    If you’re compiling php 5 on CentOS Linux with the IMAP functionality enabled you may get...

Categories: CentOS, MySQL Tags:
  1. May 5th, 2009 at 14:24 | #1

    So does CentOS not have a package manager, like Yum or Apt? I thought manually installing rpm’s was for hacks when package managers screwed things over.

    Maybe we should start using Gentoo and build everything from source heh :P

  2. May 5th, 2009 at 14:51 | #2

    Well as CentOS is RHEL its package manager is RPM ;)

    There are other reasons though why we don’t use inbuilt software management tools to mange some of our software which I’ll not go into here.

    RPM’s aren’t just for hacks though, in particular (as this is the example we’re talking about) the MySQL RPM’s are generally better builds than you’d get from doing it from source yourself.

  3. May 5th, 2009 at 15:44 | #3

    Does RHEL not use Yum? I know Fedora does, so normally (ignoring our internal systems) I’d expect a package manager to be used, right?

    The only time I’ve used RPMs is when a package isn’t available from yum repos… and surely building from source (not just MySQL, but any software) is better, as it’s tailored specifically for the system you’re using?? I’ve always found that to be the case anyway…

  4. May 5th, 2009 at 15:45 | #4

    Edit: When I say “better” I mean more tailored really. Pre-built rpms I expect contain more bloat, due to being pre-configured for all possible cases. If you build from source, that eliminates bloat by not compliling stuff that isn’t compatible with your system… I’m pretty sure that’s why Gentoo exists – to remove bloat that using package managers causes like Yum and Apt.

  5. May 5th, 2009 at 17:06 | #5

    In certain cases what you point out about tailoring is true BUT use of commercial compilers actually offer benefits aside from potential bloat.

    Again taking MySQL as a case in point, this is their take on the matter (though it doesn’t say much):

    http://dev.mysql.com/doc/refman/5.0/en/linux-rpm.html

    What you’ll see is that really the requirements for it to run are minimal outside of it’s own libraries and as such there is no real bloat caused from the precompilation.

    Actually what you find is that because compilers such as those outlined here: http://software.intel.com/en-us/intel-compilers/ are used, the generated binaries are actually of a better ‘quality’ for a particular CPU architecture than you’d be able to produce using most of the open source alternatives.

    Really, if the precompiled code from a major distributor exists for your platform you should use as it, as it’s likely to have been compiled with a pro compiler and therefore run better on your system.

    If no specific version for your system exists you may experience some bloat in some cases and might benefit from compiling the software yourself, but this is rare for most mainstream open-source packages that also have commercial variants or ties.

  1. August 12th, 2009 at 01:23 | #1