I have made a update script for SME 6.0 & SME 6.5 that upgrade MySQL to 4.1.19 from 3.23.x or 4.0.x
#!/bin/sh
clear
echo "==================================================================="
echo " Upgrade script for MySQL 4.1.19 on a fully updated (May 29, 2006) "
echo " SMEServer Version 6.0.x or 6.5 "
echo "==================================================================="
echo " Info taken from posts on contribs.org by Greg Swallow, "
echo " Ergin Ă–zdemir & Graeme Fleming "
echo " "
echo " Written by Svenn-Erik K. Thomsen - on May 29, 2006 "
echo " www ......: http://sekt.dk "
echo " e-mail ...: sekt@sekt.dk "
echo " skype-me .: svenn-erik "
echo " "
echo " --------------------------------------- "
echo " If you feel confortable with the above then press <Enter> "
echo " if not press <Ctrl>+<C> to abort the instalation "
echo "==================================================================="
read x
echo ""
mkdir -p /root/plus/mysql/mysql4119
cd /root/plus/mysql/mysql4119
rpm -qa > rpmlist
# Only for SME 6.x or above
IS_SME6X=pic rpmlist | grep -c SMEServer-6.
if [ $IS_SME6X -eq 0 ]
then
clear
echo "===================================================================="
echo " This installation only supports SME 6.0.x and SME 6.5 - Exiting... "
echo "===================================================================="
echo ""
exit
fi
echo "==================================================================="
echo " Download files neded to /root/plus/mysql/mysql4119 "
echo "==================================================================="
echo " MySQL-shared-compat-4.1.19-0.i386.rpm "
echo " MySQL-client-4.1.19-0.i386.rpm "
echo " MySQL-server-4.1.19-0.i386.rpm "
echo " MySQL-devel-4.1.19-0.i386.rpm "
echo " --------------------------------------- "
echo " perl-DBI-1.45-8.i386.rpm "
echo " perl-DBD-mysql-2.9004-8.i386.rpm "
echo "==================================================================="
read x
echo ""
wget -nc http://downloads.mysql.com/archives/mysql-4.1/MySQL-shared-compat-4.1.19-0.i386.rpm
wget -nc http://downloads.mysql.com/archives/mysql-4.1/MySQL-client-4.1.19-0.i386.rpm
wget -nc http://downloads.mysql.com/archives/mysql-4.1/MySQL-server-4.1.19-0.i386.rpm
wget -nc http://downloads.mysql.com/archives/mysql-4.1/MySQL-devel-4.1.19-0.i386.rpm
wget -nc http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-DBI-1.45-8.i386.rpm
wget -nc http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-DBD-mysql-2.9004-8.i386.rpm
echo "==================================================================="
echo " First, lets backup our all our databases just in case ... "
echo "==================================================================="
mkdir -p /root/plus/mysql/mysql4119/backup
cd /root/plus/mysql/mysql4119/backup
mysqldump --opt --all-databases >> all_databases.sql
cd ..
echo " "
echo " Backup complete - "
echo " located in /root/plus/mysql/mysql4119/backup if required "
echo "==================================================================="
read x
echo ""
echo "==================================================================="
echo " Stop MySQL "
echo "==================================================================="
echo ""
# Stop MySQL
service mysqld stop&&sleep 10
echo "==================================================================="
echo " Remove old Perl modules and Install new Perl modules "
echo "==================================================================="
echo ""
# Remove Perl modules ...
rpm -e perl-DBD=.rpm
rpm -e perl-DBI=.rpm
# Installing Perl modules ...
rpm -Uvh --force perl-=.rpm
echo "==================================================================="
echo " Checking for current MySQL version eq V3.x "
echo "==================================================================="
read x
echo ""
IS_V3x=grep -c mysql-3 rpmlist
#skip if you already have mysql 4.0
if [ $IS_V3x -ne 0 ]
then
rpm -e --nodeps mysql mysql-server
rpm -e mysql-devel
rpm -e mysqlclient9
fi
echo "==================================================================="
echo " Installing MySQL 4.1.19 modules ... "
echo "==================================================================="
read x
echo ""
# Installing MySQL 4.1 modules ...
rpm -Uvh --nodeps MySQL-=.rpm
echo "==================================================================="
echo " Run configuration routines ... "
echo "==================================================================="
read x
echo " "
echo " .. configuring MySQL 4.1 to suit SME "
/sbin/chkconfig --levels 2345 mysql on
#skip if you already have mysql 4.0
if [ $IS_V3x -ne 0 ]
then
mv /etc/rc.d/init.d/mysql /etc/rc.d/init.d/mysqld
fi
echo " "
echo " .. Recreate symlink to auto start MySQL on boot "
rm /etc/rc.d/rc7.d/S90mysqld
ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc7.d/S90mysqld
echo " "
echo " .. Configure MySQL to allow non-local connections (other than "
echo " from localhost (127.0.0.1)) "
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
echo " "
echo " .. MySQL 4.1.8 uses new password format, but can be used with "
echo " old format passwords by invoking with the --old-passwords option "
# Make a template fragment to start mysqld with option --old-passwords
mkdir -p /etc/e-smith/templates-custom/etc/my.cnf/
# Add just one line of text 'old-passwords' - without the quotes
touch /etc/e-smith/templates-custom/etc/my.cnf/010oldpasswords
echo old-passwords > /etc/e-smith/templates-custom/etc/my.cnf/010oldpasswords
chmod 644 /etc/e-smith/templates-custom/etc/my.cnf/010oldpasswords
echo " "
echo " .. Update mysql config file due to template additons "
/sbin/e-smith/expand-template /etc/my.cnf
echo " "
echo " .. Create service symlink & start MySQL "
ln -s /usr/sbin/mysqld /usr/libexec/
echo " "
echo " .. Start MySQL "
echo "==================================================================="
read x
service mysqld start&&sleep 10
echo ""
echo "==================================================================="
echo " Reconfigure databases to suit MySQL 4.1.8 "
echo " --------------------------------------- "
echo " Converting tables to MySQL 4.1.8 format ... "
MYSQL_PW=sed q /etc/openldap/ldap.pw
/usr/bin/mysql_fix_privilege_tables --user=root --password=$MYSQL_PW
echo " --------------------------------------- "
echo " If an error is reported here then the MySQL table upgrade routine "
echo " failed, check on contribs for help "
echo " Press Ctrl/C to abort this script and not run post upgrade events,"
echo " MySQL will not work until this problem is resolved "
echo " Once the problem is resolved please execute the fix.sh script "
echo " "
echo " If no error is reported then all is ok. Press enter to run "
echo " post-upgrade event and rebooting the server "
echo ""
read x
echo "==================================================================="
echo " Post-upgrade "
echo " --------------------------------------- "
echo " Post-upgrade - Please wait! "
/sbin/e-smith/signal-event post-upgrade
echo "==================================================================="
echo " Reboot Server !!!! "
echo " --------------------------------------- "
echo " If you feel confortable with the above then press <Enter> "
echo " if not press <Ctrl>+<C> to abort the instalation "
echo "==================================================================="
read x
/sbin/e-smith/signal-event reboot
echo ""
echo "==================================================================="
echo " Server is Rebooting - Please wait! "
echo "==================================================================="