Article ID: 111959, created on Aug 18, 2011, last review on May 11, 2014

  • Applies to:
  • H-Sphere 3.5 SPU
  • H-Sphere 3.5.1

Goal

Install custom-built MySQL packages instead of those supplied with H-Sphere.

Resolution

H-Sphere installs to DB host(s) the following MySQL packages:
RHEL:
MySQL-server
MySQL-client
MySQL-shared
FreeBSD:
mysql-server
mysql-client
mysql-scripts
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.

2. Reinstall
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


Examples:
RHES5_64:
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

FBSD73:
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):
 
cd /etc/init.d
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):
 
cd /usr/local/etc/rc.d
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
 

You can immediately check that H-Sphere does not remove or update your new MySQL packages by running the update, e.g.:

sh U35.0 update hspackages ips=<IP of the box where you replaced MySQL>
5. Notes
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.

 

f213b9fa8759d57bee5d547445806fe7 7f922a4e770ce85df792db1005dd3733 6311ae17c1ee52b36e68aaf4ad066387 2e39a5e5b1423cc126cf735bac076008 fafb0ebf44e50281a1f7405c629d23d5 f51a27b0a406fdfb3fcda8033c7f914d

Email subscription for changes to this article
Save as PDF