Getting Through mySQL Upgrading Hell
Prepare yourselves, because I’m about to lay some geek down on you. I haven’t had one of these posts in a while, and honestly if I don’t write this down somewhere I’ll forget what I did and then it will happen to me again. Plus its my site and I’ll write what I want.
Yesterday at work I was trying to get a feature of mySQL (The program that houses the databases for our company and many many others out there today.) going called replication. Replication is a feature that is baked into mySQL and allows a mySQL servers keep track of what is happening on it and then another server to mimic what the first server has done, so as to keep a constant backup of the first, primary, server. The little tutorial I had sounded simple enough: edit a few conf files, sync up the databases, and restart the servers. But of course it wasn’t that easy…mainly because I didn’t realize the servers that I wanted to do this on were 4.0 and 4.1 and the test servers at the office were both running 3.23 but had 4.x databases running in them. Meaning? I had to upgrade the mySQL servers on the local machines. This is where it all went bad…
I retrieved the RPMs from mySQL’s website and downloaded them to my first test server. On the site, it told me not to jump a release, so I downloaded the 4.0 release RPMs. I installed them, per the sites instructions and somehow that managed to destroy my installations. I lost my “mysql” user and group, there wasn’t any mySQL files anywhere! So much for the upgrade approach. After mulling over if I should install from source, I decided to try and just upgrade my craptastic mySQL setup from 4.0 to 4.1 via the RPMs. So I downloaded all of the RPMs and preceeded to upgrade each of them. (command: rpm -Uvh [rpm]) That worked. Ok. Awesome. Now I know how to handle the next server.
On the next server I decided to just uninstall the RPMs of mySQL 3.23 first and then install the 4.1. It uninstalled fine. When I installed 4.1 however, it looked good until it tried to start up mySQL. When the RPM or I tried to start mySQL (command: /etc/rc.d/init.d/mysql start), it failed. After talking myself away from throwing my computer out of the window, I tried to upgrade. Nope. I tried forcing the upgrade. Nope. I check to see if the user and group were there. They were. Ok last chance…I’ll check the permissions in /var/lib/mysql. Reset them all to mysql:mysql.
That worked!
Is my story boring? Why yes it is. But I felt, for the good of the internet, I had to post it up. Why? Because I searched on Google for hours yesterday at work and at home and found nothing. Now when this happens to me again…I can just search here.
UPDATE:
Nevermind. I’m still having trouble getting the mySQL server to start on the second machine. It just gives me:
[root@stanlee mike]# /etc/rc.d/init.d/mysql start
Starting MySQL…………………………….. [FAILED]
Any suggestions? Now pardon me whilst I go “Office Space” on this computer…
