GoalInstall custom-built MySQL packages instead of those supplied with H-Sphere.
ResolutionH-Sphere installs to DB host(s) the following MySQL packages:
You want to install your versions of these packages and have them unaffected by H-Sphere updates.
1. Obtaining packages
You can get binary MySQL packages from either official site http://dev.mysql.com/downloads/mysql/, or FreeBSD ports. Also, you can compile MySQL packages by yourself according to https://sites.google.com/site/hspheresystempackages/main_page/building/building-fresh-mysql-5-1-packages for obtaining new packages.
Once you obtained MySQL packages, uninstall the corresponding H-Sphere packages from the system and then install the new ones.
To make sure the H-Sphere packages will be successfully uninstalled, uninstall them with the following option:
--nodeps on RHEL
-f on FreeBSD
rpm -e --nodeps MySQL-server MySQL-client MySQL-shared
rpm -ihv MySQL-server-community-5.1.58-1.rhel5.x86_64.rpm MySQL-client-community-5.1.58-1.rhel5.x86_64.rpm MySQL-shared-community-5.1.58-1.rhel5.x86_64.rpm
pkg_delete -f mysql-server-5.1.49 mysql-client-5.1.49 mysql-scripts-5.1.49
pkg_add -f mysql-server-5.1.58.tgz mysql-client-5.1.58.tgz mysql-scripts-5.1.58.tgz
The name of the MySQL init script may change between releases. You should check the existence of the init script immediately after the MySQL update and create a symlink from an old location to a new one if necessary. The supported init script locations for Linux: /etc/rc.d/init.d/mysqld, /etc/rc.d/init.d/mysql, /etc/init.d/mysqld, /etc/init.d/mysql; for FreeBSD: /usr/local/etc/rc.d/mysql-server.sh, /usr/local/etc/rc.d/mysql-server (supported since 3.4.1 SPU 50, 3.5.1 SPU 51, 3.6.0). The complete example for Linux looks as follows (old script - /etc/init.d/mysql, new script - /etc/init.d/mysql-server):
ln -s mysql-server mysql
The complete example for FreeBSD looks as follows (old script - /usr/local/etc/rc.d/mysql-server.sh, new script - /usr/local/etc/rc.d/mysql-server):
ln -s mysql-server mysql-server.sh
3. Configure H-Sphere
Configure H-Sphere to ignore these packages during the further updates. This is done with the installer/updater's exclude-mysql=add option, e.g.:
sh U35.0 update hspackages exclude-mysql=add ips=<IP of the box where you replaced MySQL>
Note: for H-Sphere versions earlier than 3.5.1 SPU 51 you also need to add the line “MySQL-“ to the file /hsphere/shared/etc/excludepkglist on a MySQL server. Example for Linux:
echo “MySQL-“ >> /hsphere/shared/etc/excludepkglist
4. Verify configuration
sh U35.0 update hspackages ips=<IP of the box where you replaced MySQL>
When replacing MySQL packages, please be aware that:
1) If you replace MySQL packages with ones of a different minor version, you should backup your MySQL databases and run mysql_upgrade after such replacement.
2) H-Sphere's PHP modules are linked with the MySQL client library of the 5.1 minor versions, and hence you need to pick a minor version that will be compatible with 5.1.