Thursday, 9 September 2010

Installing MySQL on RHEL4 without a RHN account


I needed to install a recent MySQL version, 5.1.50 in this case, on a server Red Hat Enterprise Linux 4. As I normally do on the binary equivalent CentOS I tried the yum command, but this apparently isn't available in version 4 of the operating system. Some Googling made clear that on RHEL 4 you need to use the up2date command instead of yum.

When I tried this new command I was presented with a screen that ask for a valid Red Hat Network (RHN) account, which I don't have as the server is owned and was installed by another consultancy firm that works for this customer.


I know I could ask the customer to give me the necessary information or at least try to find it or get it from the other firm, but that would take too long. But, as is usually the case, there's always another way - in this case - do a more manual install using an RPM package.

Two RPMs are needed: MySQL-server-community-5.1.50-1.rhel4.i386.rpm and MySQL-client-community-5.1.50-1.rhel4.i386.rpm, both the 32-bit ones for RHEL4. Installing them should be easy using e.g. rpm -i MySQL-server-community-5.1.50-1.rhel4.i386.rpm, but as usual this isn't the case and I get an error:

error: Failed dependencies: MySQL conflicts with mysql-4.1.22-2.el4.i386

A bit more Googling turned up this link in the MySQL bug tracker that described the same issue and error message. After reading through the issue a solution was found: remove the old MySQL version with the following command: rpm -e mysql-4.1.22-2.el4 --nodeps.

After this I was able to issue two rpm -i commands for the RPM files I downloaded and the MySQL server and client were installed and the MySQL was started. After this you just need to change the MySQL root password for security reasons using mysqladmin -u root password newpassword and you're good to go.

No comments:

Post a Comment