Upgrading mysql and php
From LeonWiki!
I started from:
- mysql 5.0.27
- php 5.1.6
target:
- mysql 5.1.31
- php 5.2.9
This was a bear, just because rpm and yum installs don't work for me. So I downloaded the most recent mysql rpm Community package that I could find and installed via rpm. IMPORTANT! : client libs are no longer included in the src/bin dists for mysql. You must download client libs or devel dists to pickup these files/libs.
The total incongruity of installs/upgrades on linux is definitely not for the faint of heart. I've been doing this for over 25 years (well not linux) and I dread doing an upgrade if the package managers can't find the packages for some reason.
Anyway, I used synaptic gui to uninstall the mysql packages after backing up my schemas. Mysql handled the upgrade like a champ, preserving all my data. But of course, when you package install, you are in the dark as to where those files were installed. I know that you can get that info via rpm, but I find it somewhat cryptic.
IMPORTANT! You must have --include-mysql for the configure command line or the libs will not be built. I was also interested in soap, so --with-soap is also important.
This is the configure line I ended up with that seems to be working fine:
- ./configure --with-apxs2=/home/rsie/apache2/bin/apxs --enable-soap --enable-shared --bindir=/usr/bin --with-config-file-path=/etc --with-mysql=/usr/include/mysql/ --without-pear --with-libdir=lib/mysql --with-zlib --with-openssl=/usr
The problem I had, after all the upgrades/installs, was that php couldn't recognize mysql. I had everything setup correctly, and I restarted the pertinent servers, but a reboot was required before everything worked together.
Prior to the reboot, php was looking for the mysql.sock at /tmp/mysql.sock when the mysql install put it in /var/lib/mysql. So after the reboot everything synced up and we're running again.
