Koozali.org: home of the SME Server

MySQL 4.1.8 installation howto

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« on: January 03, 2005, 12:11:44 AM »
Please, please don't try this on anything but a test server and a fresh install...You have been warned :-)

EDIT: Bit of info on this thread as well:
http://forums.contribs.org/index.php?topic=25396.0

This isn't a script - you will have to do this step by step.  I have only tried this upgrading straight from mysql3 to mysql 4.1.8, but I put nots on what would be ok to leave out if you have mysql 4.0 already - but remember my warning above...

I have only tested that webmail and phpmyadmin work after this - nothing else.  This is definitly not a finisted product - please if you want to help, try this on a test server and take a look at: http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html - there are some other things I have not done that need to be done that are described there.  Much more testing is needed and maybe a few more rpms - the site above talks about DB 4.1 and perl DBD or DBI packages needing to be updated for example.  

Code: [Select]
Instructions For Upgrading to MySQL 4.1.8

#Install phpmyadmin - needed to find default mysql root password
wget http://mirror.contribs.org/smeserver/contribs/nightspirit/e-smith-phpmyadmin/e-smith-phpmyadmin-2.6.0-12.noarch.rpm
rpm -Uvh e-smith-phpmyadmin-*.rpm
#look in this file for the default password - you will need it in a minute - write it down carefully :-)
pico /opt/administration/phpmyadmin/config.inc.php

wget ftp://mysql.mirrored.ca/MySQL-4.1/MySQL-server-4.1.8-0.i386.rpm
wget ftp://mysql.mirrored.ca/MySQL-4.1/MySQL-devel-4.1.8-0.i386.rpm
wget ftp://mysql.mirrored.ca/MySQL-4.1/MySQL-client-4.1.8-0.i386.rpm
wget ftp://mysql.mirrored.ca/MySQL-4.1/MySQL-shared-compat-4.1.8-0.i386.rpm

#skip if you already have mysql 4.0
rpm -e --nodeps mysql mysql-server
rpm -e mysql-devel
rpm -e mysqlclient9

service mysqld stop

rpm -Uvh MySQL-*.rpm

/sbin/chkconfig --levels 2345 mysql on

#skip if you already have mysql 4.0
mv /etc/rc.d/init.d/mysql /etc/rc.d/init.d/mysqld

rm /etc/rc.d/rc7.d/S90mysqld
ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc7.d/S90mysqld
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no

#make a template fragment to start mysqld with option --old-passwords
mkdir -p /etc/e-smith/templates-custom/etc/my.cnf/

pico /etc/e-smith/templates-custom/etc/my.cnf/010oldpasswords
#add just one line of text 'old-passwords' - without the quotes

/sbin/e-smith/expand-template /etc/my.cnf

ln -s /usr/sbin/mysqld /usr/libexec/
service mysqld start

/usr/bin/mysql_fix_privilege_tables --password=YOUR76CHARACTERPASSWORD
#if you typed it in exactly it should say - done - not give you an error

/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
MySQL 4.1.8 installation howto
« Reply #1 on: January 03, 2005, 12:28:59 AM »
Ohhh Greg..many many many thanks!!!!! I test this night :)

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« Reply #2 on: January 03, 2005, 03:10:18 AM »
Would anyone be able to help by making rpms for these perl modules:
http://cpan.mirror.cygnal.ca/authors/id/T/TI/TIMB/DBI-1.46.tar.gz
http://cpan.mirror.cygnal.ca/authors/id/R/RU/RUDY/DBD-mysql-2.9004.tar.gz

These are required by MySQL 4.1.8 - see documentation here:
http://dev.mysql.com/doc/mysql/en/Perl_support.html

It is also possible to install them with CPAN:
http://dev.mysql.com/doc/mysql/en/Perl_installation.html - but rpms would be better.


ergozd

Feedback - MySQL 4.1.8 upgrade
« Reply #4 on: January 03, 2005, 10:13:05 AM »
It seems to work (at least those applications I tried)

I installed and tried
- horde (webmail)
- catalog
- phpnuke
- phpdbform
- ultraapps
- phpmyadmin
- mambo

Best rgds, Ergin

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« Reply #5 on: January 03, 2005, 10:52:12 AM »
Thanks Ergin, rpmpan must not rank very high on google, believe it or not I looked really hard for those :-P

I had to rpm -e the existing perl rpms and then -Uvh the new ones.  They install without errors that way.

I did read on the mysql website that they recommend to upgrade from 3.23 to 4, then from 4 to 4.1, so maybe that is a better way to do it, but this seems to work as well.

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
MySQL 4.1.8 installation howto
« Reply #6 on: January 03, 2005, 02:12:23 PM »
Work ok!!!! Horde, Nag, etc...
And the most important for me, local access to use with commercial manager software.
I installed DBD and DBI via CPAN and run ok.
Thank you very much Greg
PicsOne

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« Reply #7 on: January 04, 2005, 06:30:28 PM »
Quote from: "PicsOne"
commercial manager software.


What software?

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« Reply #8 on: January 04, 2005, 10:10:08 PM »
One more thing to do:
http://php.net/mysqli
...supports the added functionality of mysql 4.1 - Looks like the PHP rpms have to be compiled with support for this and some changes to php.ini are needed.

Also, this isn't installed on e-smith by default, but I think some people are using the RPM 'mysql-python' - it needs to be updated - http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=34790
- version 1.1.8 is compatible with mysql 4.1 and python 2.3.4.
...I didn't find a 1.1.8 mysql-python rpm, but you will also need...
http://mirror.contribs.org/smeserver/contribs/ddougan/Plone/db4-4.1.25-0.rh73.3.1.i386.rpm
http://mirror.datapipe.net/norlug/redhat-7.3/RPMS/python2.4-2.4-3.norlug.i386.rpm

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
MySQL 4.1.8 installation howto
« Reply #9 on: January 04, 2005, 11:08:21 PM »
Wow Greg, your you are a specialist. You have worked a lot.
Thanks for your contributions.
As you can see, MySQL 4.1.x has more advantages over 4.0.x or below.
The commercial software I mention above, is refered to a software system I used to manage an ink cartridges store in my town. And use mysql and php. This soft is under development now. And thanks to you, now the development is more easy, because mysql 4.1.x

Offline smeghead

  • *
  • 557
  • +0/-0
MySQL 4.1.8 installation howto
« Reply #10 on: January 07, 2005, 06:03:29 AM »
Hi all

I have scripted this installation to remove the manual aspects of the process and to verify that all files have been downloaded before the upgrade proceeds.

I just used it to update a server I am building and it showed up a coupla minor bugs (typos, doh!) that I have already fixed.

Please treat it as beta but it works for me :-)

#!/bin/sh

clear

echo "Install script for MySQL 4.1.8"

# Info taken from posts on contribs.org by Greg Swallow & Ergin Ă–zdemir
# Written by Graeme Fleming - smeghead on January 5, 2005

cd /root

rpm -qa > rpmlist

# Only for SME 6.0.x or above

IS_SME60=pic rpmlist | grep -c SMEServer-6.0

if [ $IS_SME60 -eq 0 ]
then
echo "This installation only supports SME 6.0.x - Exiting..."
cd /root
exit
fi

# Only install over V4.0 as per MySQL site recommendation

echo "Checking for current MySQL version, needs to be V4.0.x ..."

IS_V3x=grep -c mysql-3 rpmlist

if [ $IS_V3x -ne 0 ]
then
echo ".. MySQL V3 found, please upgrade to V4.0 before installing V4.1 as recommended at http://www.mysql.org"
cd /root
exit
fi

IS_V40=grep -c mysql-4.0 rpmlist

if [ $IS_V40 -ne 0 ]
then
# Set var for downloaded files location for this script
# create the MySQL download directory
cd /root
mkdir -p mysql4.1.8
cd mysql4.1.8
DL_DIR=/root/mysql4.1.8
echo "MySQL V4.0 found, starting the upgrade process ..." | tee $DL_DIR/install.log
echo ""
fi

echo "First, lets backup our all our databases just in case ..."
mkdir -p $DL_DIR/backup
cd $DL_DIR/backup
mysqldump --opt --all-databases > all_databases.sql | tee $DL_DIR/install.log
echo "Backup complete - located in "$DL_DIR"/backup if required"
cd ..

# Setup download source locations

MYSQL_DL=ftp://mysql.mirrored.ca/MySQL-4.1
PERL_DL=http://www.quantumlinux.com/~kevin/rpmpan/rpm
PHPMY_DL=http://mirror.contribs.org/smeserver/contribs/nightspirit

echo "Downloading MySQL V4.1 files ..."

wget -nc -nd -S $MYSQL_DL/MySQL-server-4.1.8-0.i386.rpm -a $DL_DIR/install.log
wget -nc -nd -S $MYSQL_DL/MySQL-devel-4.1.8-0.i386.rpm -a $DL_DIR/install.log
wget -nc -nd -S $MYSQL_DL/MySQL-client-4.1.8-0.i386.rpm -a $DL_DIR/install.log
wget -nc -nd -S $MYSQL_DL/MySQL-shared-compat-4.1.8-0.i386.rpm -a $DL_DIR/install.log

echo "Downloading required Perl modules ..."
wget -nc -nd -S $PERL_DL/perl-DBI-1.45-8.i386.rpm -a $DL_DIR/install.log
wget -nc -nd -S $PERL_DL/perl-DBD-mysql-2.9004-8.i386.rpm -a $DL_DIR/install.log

echo "Downloading phpmyadmin required module ..."
wget -nc -nd -S $PHPMY_DL/e-smith-phpmyadmin/e-smith-phpmyadmin-2.6.0-12.noarch.rpm -a $DL_DIR/install.log

# Test to make sure all files were downloaded correctly and none are missing before trying to run install
# Build list of files and then test against this list
# We really don't want to run this unless we have all the bits

ls -1 > dllist

if [ pic dllist | grep MySQL-server-4 | wc -l -eq 0 ]
then
echo ".. MySQL-server-4.1.8-0.i386.rpm failed to download from" $MYSQL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep MySQL-devel-4 | wc -l -eq 0 ]
then
echo ".. MySQL-devel-4.1.8-0.i386.rpm failed to download from" $MYSQL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep MySQL-client-4 | wc -l -eq 0 ]
then
echo ".. MySQL-client-4.1.8-0.i386.rpm failed to download from" $MYSQL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep MySQL-shared-compat-4 | wc -l -eq 0 ]
then
echo ".. MySQL-shared-compat-4.1.8-0.i386.rpm failed to download from" $MYSQL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep perl-DBI | wc -l -eq 0 ]
then
echo ".. perl-DBI-1.45-8.i386.rpm failed to download from" $PERL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep perl-DBD-mysql | wc -l -eq 0 ]
then
echo ".. perl-DBD-mysql-2.9004-8.i386.rpm failed to download from" $PERL_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

if [ pic dllist | grep e-smith-phpmyadmin | wc -l -eq 0 ]
then
echo ".. e-smith-phpmyadmin failed to download from" $PHPMY_DL "correctly, please excute script again at a later time, or check manually for the missing file"
exit
fi

# Remove dllist file, no longer required
rm -f dllist

echo "Downloading completed without errors, proceeding with the install ..." | tee $DL_DIR/install.log

# Install phpmyadmin - needed to find default mysql root password
echo "Installing phpmysqladmin ..."
rpm -Uvh e-smith-phpmyadmin-*.rpm

# Parsing MySQL password from phpmyadmin config file; assumes there will be no semicolon/single quote in password
echo "Extracting MySQL password from config.inc.php ..." | tee $DL_DIR/install.log
MYSQL_PW=grep \'Servers\' /opt/administration/phpmyadmin/config.inc.php | grep \'password\' | awk ' { print $3 } ' | sed "/'';/d; s/\;//g; s/'//g"
echo "MySQL password is:  "$MYSQL_PW | tee $DL_DIR/install.log

# Install Perl modules
echo "Installing Perl modules ..."
rpm -Uvh perl-*.rpm

# Install MySQL 4.1 files
echo "Installing MySQL 4.1 modules ..."
service mysqld stop
rpm -Uvh MySQL-*.rpm

# Run configuration routines
echo ".. configuring MySQL 4.1 to suit SME, this will take a few moments ..."
/sbin/chkconfig --levels 2345 mysql on

# 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

# Configure MySQL to allow non-local connections (other than from localhost (127.0.0.1))
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no

# MySQL 4.1.8 uses new password format, but can be used with 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

# Update mysql config file due to template additons
/sbin/e-smith/expand-template /etc/my.cnf

# Create service symlink & start MySQL
ln -s /usr/sbin/mysqld /usr/libexec/
service mysqld start

clear

# Reconfigure databases to suit MySQL 4.1.8
echo "Converting tables to MySQL 4.1.8 format ..."
/usr/bin/mysql_fix_privilege_tables --password=$MYSQL_PW

#if you typed it in exactly it should say - done - not give you an error
echo "If an error is reported here then the MySQL table upgrade routine failed, check on contribs for help"
echo "Press Ctrl/C to abort this script and not run post upgrade events, 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 post-upgrade event and rebooting the server"
echo ""
wait
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

HTH
..................

ergozd

MySQL 4.1.8 installation howto
« Reply #11 on: January 07, 2005, 03:01:27 PM »
Hi Graeme!

Nice script, this will make life easier for many of us. Thanx.

I am NOT 100% sure so I'll ask.
MySQL root password is different in SME v6 and v6.01-01 so wouldn't it be better to grep password from /root/my.cnf instead of /opt/administration/phpmyadmin/config.inc.php

Best rgds, Ergin

Offline smeghead

  • *
  • 557
  • +0/-0
MySQL 4.1.8 installation howto
« Reply #12 on: January 07, 2005, 06:21:19 PM »
Hi Ergin

Thanks, the main reason for my writing these scripts is so I don't have to remember the idiosyncrasies of any particular package, and to eliminate dumb mistakes from any server build I do.  Most of them are just a rehash of what I have found on contribs (credit to all those whose work I have unashamedly stolen :-)) with the addition of a bit more documentation and error trapping.

You may well be right on the password, tho I don't rightly know.  When phpmyadmin is installed it gets the password from MySQL so there must be some sorta linkage even if its only indirect.
..................

Offline gregswallow

  • *
  • 651
  • +1/-0
MySQL 4.1.8 installation howto
« Reply #13 on: January 07, 2005, 07:17:19 PM »
You are too fast smeghead - I was going to do that :-P

Nice job!!!

About the password, I just figured out it is also located in /etc/openldap/ldap.pw - so installing phpmyadmin is not necessary.  If you look in /etc/e-smith/templates/root/.my.cnf you will see that's where the /root/.my.cnf file gets it from.

For the next challenge... :-P
If we get Horde 3/IMP 4 working (no rpm's available, but they are final), we can use PHP5. 8-)

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
MySQL 4.1.8 installation howto
« Reply #14 on: January 20, 2005, 03:39:02 AM »
Quote from: "gregswallow"
For the next challenge... :-P
If we get Horde 3/IMP 4 working (no rpm's available, but they are final), we can use PHP5. 8-)


Did you happen to see my devinfo post on installing the latest versions of horde/imp/turba/kronolith/mnemo/nag/ingo on SME 6.01-01?  

Didn't play with php5.

JB

[edit]
References to links removed as they are no longer valid.
......