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.

Wednesday, 8 September 2010

The future of this blog

I know I haven't been blogging lately, but due to time constraints I can't find enough time for long post. That's why I've been trying out Twitter lately and I must say I like it. You can follow me on Twitter under the nickname planetsizebrain.

However this blog isn't exactly dead. Whenever I encounter something interesting in the future that's worth blogging about and that can't be expressed in a tweet, I'll be posting it here on the blog.

Monday, 10 May 2010

Authenticated downloads using WGET

Today I needed to download an Adobe Livecyle ES 2 trial version directly to a headless Amazon EC2 instance. So I wanted to use wget and for most downloads, direct downloads this is pretty easy: wget http://www.somesite.com/download.zip. The problem I had, was that you need to be logged into the Adobe site to be able to download the trial. The login basically means that cookies are created and because wget supports cookies I just needed a way to capture the cookies in the correct format to some file on disk.

This can be easily done using the Firefox Cookie Exporter add-on. I just needed to open the Adobe site in Firefox, log in and click Tools > Export Cookies... . This will save all the current cookies to a file on disk. This file can then be used together with the --load-cookies switch present in wget to submit all the cookies present in the file when doing a web request.